PX*1*210 TEST v3
Extracted from mail message
**KIDS**:PX*1.0*210^

**INSTALL NAME**
PX*1.0*210
"BLD",9275,0)
PX*1.0*210^PCE PATIENT CARE ENCOUNTER^0^3150825^y
"BLD",9275,1,0)
^^7^7^3150819^
"BLD",9275,1,1,0)
The Veterans Health Information Systems and Technology Architecture
"BLD",9275,1,2,0)
(VistA) Immunizations Enhancements (VIMM) 2.0 project, Increment 2, 
"BLD",9275,1,3,0)
builds upon the file structures and standardized data introduced by 
"BLD",9275,1,4,0)
Increment 1 by adding functional enhancements to the existing VistA 
"BLD",9275,1,5,0)
Patient Care Encounter (PCE) package.
"BLD",9275,1,6,0)
 
"BLD",9275,1,7,0)
See the National Patch Module for a more detailed description.
"BLD",9275,4,0)
^9.64PA^9000010.12^3
"BLD",9275,4,9000010.11,0)
9000010.11
"BLD",9275,4,9000010.11,222)
y^y^f^^^^n
"BLD",9275,4,9000010.12,0)
9000010.12
"BLD",9275,4,9000010.12,222)
y^y^f^^^^n
"BLD",9275,4,9999999.41,0)
9999999.41
"BLD",9275,4,9999999.41,222)
y^y^f^^^^n
"BLD",9275,4,"B",9000010.11,9000010.11)

"BLD",9275,4,"B",9000010.12,9000010.12)

"BLD",9275,4,"B",9999999.41,9999999.41)

"BLD",9275,6.3)
11
"BLD",9275,"ABPKG")
n
"BLD",9275,"INI")
PRE^PXVP210
"BLD",9275,"INID")
^n^n
"BLD",9275,"INIT")
POST^PXVP210
"BLD",9275,"KRN",0)
^9.67PA^779.2^20
"BLD",9275,"KRN",.4,0)
.4
"BLD",9275,"KRN",.401,0)
.401
"BLD",9275,"KRN",.402,0)
.402
"BLD",9275,"KRN",.403,0)
.403
"BLD",9275,"KRN",.5,0)
.5
"BLD",9275,"KRN",.84,0)
.84
"BLD",9275,"KRN",3.6,0)
3.6
"BLD",9275,"KRN",3.8,0)
3.8
"BLD",9275,"KRN",9.2,0)
9.2
"BLD",9275,"KRN",9.8,0)
9.8
"BLD",9275,"KRN",9.8,"NM",0)
^9.68A^28^27
"BLD",9275,"KRN",9.8,"NM",2,0)
PXAIIMM^^0^B14255138
"BLD",9275,"KRN",9.8,"NM",3,0)
PXAIIMMV^^0^B19623180
"BLD",9275,"KRN",9.8,"NM",4,0)
PXKENC^^0^B29230371
"BLD",9275,"KRN",9.8,"NM",5,0)
PXKIMM^^0^B39277541
"BLD",9275,"KRN",9.8,"NM",6,0)
PXKMAIN^^0^B55417967
"BLD",9275,"KRN",9.8,"NM",7,0)
PXKMAIN1^^0^B39993012
"BLD",9275,"KRN",9.8,"NM",8,0)
PXKMASC^^0^B56481802
"BLD",9275,"KRN",9.8,"NM",9,0)
PXRHS03^^0^B30812886
"BLD",9275,"KRN",9.8,"NM",10,0)
PXPXRM^^0^B88904295
"BLD",9275,"KRN",9.8,"NM",11,0)
PXAPI^^0^B38904536
"BLD",9275,"KRN",9.8,"NM",12,0)
PXAPIIM^^0^B2741056
"BLD",9275,"KRN",9.8,"NM",13,0)
PXPXRMI1^^0^B55159505
"BLD",9275,"KRN",9.8,"NM",14,0)
PXCEVIMM^^0^B68979486
"BLD",9275,"KRN",9.8,"NM",15,0)
PXCEVFI1^^0^B23008473
"BLD",9275,"KRN",9.8,"NM",16,0)
PXAISK^^0^B12663115
"BLD",9275,"KRN",9.8,"NM",17,0)
PXCESK^^0^B21683167
"BLD",9275,"KRN",9.8,"NM",18,0)
PXKFSK^^0^B3471699
"BLD",9275,"KRN",9.8,"NM",19,0)
PXVEDIT^^0^B3545122
"BLD",9275,"KRN",9.8,"NM",20,0)
PXVINV^^0^B25607410
"BLD",9275,"KRN",9.8,"NM",21,0)
PXVNITLY^^0^B518720
"BLD",9275,"KRN",9.8,"NM",22,0)
PXVUTL^^0^B4415955
"BLD",9275,"KRN",9.8,"NM",23,0)
PXVXR^^0^B12103337
"BLD",9275,"KRN",9.8,"NM",24,0)
PXRPC^^0^B108100754
"BLD",9275,"KRN",9.8,"NM",25,0)
PXCASK^^0^B16288608
"BLD",9275,"KRN",9.8,"NM",26,0)
PXCAVIMM^^0^B21317143
"BLD",9275,"KRN",9.8,"NM",27,0)
PXVUTIL^^0^B5632324
"BLD",9275,"KRN",9.8,"NM",28,0)
PXKFIMM^^0^B4427968
"BLD",9275,"KRN",9.8,"NM","B","PXAIIMM",2)

"BLD",9275,"KRN",9.8,"NM","B","PXAIIMMV",3)

"BLD",9275,"KRN",9.8,"NM","B","PXAISK",16)

"BLD",9275,"KRN",9.8,"NM","B","PXAPI",11)

"BLD",9275,"KRN",9.8,"NM","B","PXAPIIM",12)

"BLD",9275,"KRN",9.8,"NM","B","PXCASK",25)

"BLD",9275,"KRN",9.8,"NM","B","PXCAVIMM",26)

"BLD",9275,"KRN",9.8,"NM","B","PXCESK",17)

"BLD",9275,"KRN",9.8,"NM","B","PXCEVFI1",15)

"BLD",9275,"KRN",9.8,"NM","B","PXCEVIMM",14)

"BLD",9275,"KRN",9.8,"NM","B","PXKENC",4)

"BLD",9275,"KRN",9.8,"NM","B","PXKFIMM",28)

"BLD",9275,"KRN",9.8,"NM","B","PXKFSK",18)

"BLD",9275,"KRN",9.8,"NM","B","PXKIMM",5)

"BLD",9275,"KRN",9.8,"NM","B","PXKMAIN",6)

"BLD",9275,"KRN",9.8,"NM","B","PXKMAIN1",7)

"BLD",9275,"KRN",9.8,"NM","B","PXKMASC",8)

"BLD",9275,"KRN",9.8,"NM","B","PXPXRM",10)

"BLD",9275,"KRN",9.8,"NM","B","PXPXRMI1",13)

"BLD",9275,"KRN",9.8,"NM","B","PXRHS03",9)

"BLD",9275,"KRN",9.8,"NM","B","PXRPC",24)

"BLD",9275,"KRN",9.8,"NM","B","PXVEDIT",19)

"BLD",9275,"KRN",9.8,"NM","B","PXVINV",20)

"BLD",9275,"KRN",9.8,"NM","B","PXVNITLY",21)

"BLD",9275,"KRN",9.8,"NM","B","PXVUTIL",27)

"BLD",9275,"KRN",9.8,"NM","B","PXVUTL",22)

"BLD",9275,"KRN",9.8,"NM","B","PXVXR",23)

"BLD",9275,"KRN",19,0)
19
"BLD",9275,"KRN",19,"NM",0)
^9.68A^3^3
"BLD",9275,"KRN",19,"NM",1,0)
PXTT TABLE MAINTENANCE^^2
"BLD",9275,"KRN",19,"NM",2,0)
PXTT EDIT IMMUNIZATION LOT^^0
"BLD",9275,"KRN",19,"NM",3,0)
PXVTASK-NIGHT^^0
"BLD",9275,"KRN",19,"NM","B","PXTT EDIT IMMUNIZATION LOT",2)

"BLD",9275,"KRN",19,"NM","B","PXTT TABLE MAINTENANCE",1)

"BLD",9275,"KRN",19,"NM","B","PXVTASK-NIGHT",3)

"BLD",9275,"KRN",19.1,0)
19.1
"BLD",9275,"KRN",19.1,"NM",0)
^9.68A^1^1
"BLD",9275,"KRN",19.1,"NM",1,0)
PXV IMM INVENTORY MGR^^0
"BLD",9275,"KRN",19.1,"NM","B","PXV IMM INVENTORY MGR",1)

"BLD",9275,"KRN",101,0)
101
"BLD",9275,"KRN",409.61,0)
409.61
"BLD",9275,"KRN",771,0)
771
"BLD",9275,"KRN",779.2,0)
779.2
"BLD",9275,"KRN",870,0)
870
"BLD",9275,"KRN",8989.51,0)
8989.51
"BLD",9275,"KRN",8989.52,0)
8989.52
"BLD",9275,"KRN",8994,0)
8994
"BLD",9275,"KRN",8994,"NM",0)
^9.68A^1^1
"BLD",9275,"KRN",8994,"NM",1,0)
PX SAVE DATA^^0
"BLD",9275,"KRN",8994,"NM","B","PX SAVE DATA",1)

"BLD",9275,"KRN","B",.4,.4)

"BLD",9275,"KRN","B",.401,.401)

"BLD",9275,"KRN","B",.402,.402)

"BLD",9275,"KRN","B",.403,.403)

"BLD",9275,"KRN","B",.5,.5)

"BLD",9275,"KRN","B",.84,.84)

"BLD",9275,"KRN","B",3.6,3.6)

"BLD",9275,"KRN","B",3.8,3.8)

"BLD",9275,"KRN","B",9.2,9.2)

"BLD",9275,"KRN","B",9.8,9.8)

"BLD",9275,"KRN","B",19,19)

"BLD",9275,"KRN","B",19.1,19.1)

"BLD",9275,"KRN","B",101,101)

"BLD",9275,"KRN","B",409.61,409.61)

"BLD",9275,"KRN","B",771,771)

"BLD",9275,"KRN","B",779.2,779.2)

"BLD",9275,"KRN","B",870,870)

"BLD",9275,"KRN","B",8989.51,8989.51)

"BLD",9275,"KRN","B",8989.52,8989.52)

"BLD",9275,"KRN","B",8994,8994)

"BLD",9275,"REQB",0)
^9.611^11^10
"BLD",9275,"REQB",1,0)
PX*1.0*13^2
"BLD",9275,"REQB",2,0)
PX*1.0*162^2
"BLD",9275,"REQB",3,0)
PX*1.0*164^2
"BLD",9275,"REQB",4,0)
PX*1.0*178^2
"BLD",9275,"REQB",5,0)
PX*1.0*183^2
"BLD",9275,"REQB",6,0)
PX*1.0*185^2
"BLD",9275,"REQB",7,0)
PX*1.0*194^2
"BLD",9275,"REQB",9,0)
PX*1.0*209^2
"BLD",9275,"REQB",10,0)
PX*1.0*206^2
"BLD",9275,"REQB","B","PX*1.0*13",1)

"BLD",9275,"REQB","B","PX*1.0*162",2)

"BLD",9275,"REQB","B","PX*1.0*164",3)

"BLD",9275,"REQB","B","PX*1.0*178",4)

"BLD",9275,"REQB","B","PX*1.0*183",5)

"BLD",9275,"REQB","B","PX*1.0*185",6)

"BLD",9275,"REQB","B","PX*1.0*194",7)

"BLD",9275,"REQB","B","PX*1.0*206",10)

"BLD",9275,"REQB","B","PX*1.0*209",9)

"FIA",9000010.11)
V IMMUNIZATION
"FIA",9000010.11,0)
^AUPNVIMM(
"FIA",9000010.11,0,0)
9000010.11IP
"FIA",9000010.11,0,1)
y^y^f^^^^n
"FIA",9000010.11,0,10)

"FIA",9000010.11,0,11)

"FIA",9000010.11,0,"RLRO")

"FIA",9000010.11,0,"VR")
1.0^PX
"FIA",9000010.11,9000010.11)
0
"FIA",9000010.11,9000010.1111)
0
"FIA",9000010.11,9000010.112)
0
"FIA",9000010.11,9000010.1126)
0
"FIA",9000010.11,9000010.1127)
0
"FIA",9000010.11,9000010.113)
0
"FIA",9000010.12)
V SKIN TEST
"FIA",9000010.12,0)
^AUPNVSK(
"FIA",9000010.12,0,0)
9000010.12IP
"FIA",9000010.12,0,1)
y^y^f^^^^n
"FIA",9000010.12,0,10)

"FIA",9000010.12,0,11)

"FIA",9000010.12,0,"RLRO")

"FIA",9000010.12,0,"VR")
1.0^PX
"FIA",9000010.12,9000010.12)
0
"FIA",9000010.12,9000010.123)
0
"FIA",9000010.12,9000010.1231)
0
"FIA",9999999.41)
IMMUNIZATION LOT
"FIA",9999999.41,0)
^AUTTIML(
"FIA",9999999.41,0,0)
9999999.41I
"FIA",9999999.41,0,1)
y^y^f^^^^n
"FIA",9999999.41,0,10)

"FIA",9999999.41,0,11)

"FIA",9999999.41,0,"RLRO")

"FIA",9999999.41,0,"VR")
1.0^PX
"FIA",9999999.41,9999999.41)
0
"INI")
PRE^PXVP210
"INIT")
POST^PXVP210
"IX",9000010.11,9000010.11,"ACR",0)
9000010.11^ACR^Clinical Reminders index.^MU^^R^IR^I^9000010.11^^^^^A
"IX",9000010.11,9000010.11,"ACR",.1,0)
^^8^8^3081110
"IX",9000010.11,9000010.11,"ACR",.1,1,0)
This cross-reference builds two indexes, one for finding
"IX",9000010.11,9000010.11,"ACR",.1,2,0)
all patients with a particular immunization and one for finding all
"IX",9000010.11,9000010.11,"ACR",.1,3,0)
the immunizations a patient has.
"IX",9000010.11,9000010.11,"ACR",.1,4,0)
The indexes are stored in the Clinical Reminders index global as:
"IX",9000010.11,9000010.11,"ACR",.1,5,0)
 ^PXRMINDX(9000010.11,"IP",IMMUNIZATION,DFN,VISIT DATE,DAS) and
"IX",9000010.11,9000010.11,"ACR",.1,6,0)
 ^PXRMINDX(9000010.11,"PI",DFN,IMMUNIZATION,VISIT DATE,DAS)
"IX",9000010.11,9000010.11,"ACR",.1,7,0)
respectively.
"IX",9000010.11,9000010.11,"ACR",.1,8,0)
For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual.
"IX",9000010.11,9000010.11,"ACR",1)
D SVFILE^PXPXRM(9000010.11,.X,.DA)
"IX",9000010.11,9000010.11,"ACR",2)
D KVFILE^PXPXRM(9000010.11,.X,.DA)
"IX",9000010.11,9000010.11,"ACR",2.5)
K ^PXRMINDX(9000010.11)
"IX",9000010.11,9000010.11,"ACR",11.1,0)
^.114IA^3^3
"IX",9000010.11,9000010.11,"ACR",11.1,1,0)
1^F^9000010.11^.01^^1^F
"IX",9000010.11,9000010.11,"ACR",11.1,2,0)
2^F^9000010.11^.02^^2^F
"IX",9000010.11,9000010.11,"ACR",11.1,3,0)
3^F^9000010.11^.03^^3^F
"IX",9000010.11,9000010.11,"AH",0)
9000010.11^AH^Hours between administration and reading^MU^^R^IR^I^9000010.11^^^^^A
"IX",9000010.11,9000010.11,"AH",.1,0)
^^3^3^3150818^
"IX",9000010.11,9000010.11,"AH",.1,1,0)
This cross reference calculates the number of hours between the EVENT 
"IX",9000010.11,9000010.11,"AH",.1,2,0)
DATE AND TIME field (#1201) and the DATE/TIME READ field (#1403) and 
"IX",9000010.11,9000010.11,"AH",.1,3,0)
stores that value in the HOURS READ POST-INOCULATION field (#1406).
"IX",9000010.11,9000010.11,"AH",1)
D HRS^PXVUTIL Q
"IX",9000010.11,9000010.11,"AH",1.4)
S X=(X(1)'="")
"IX",9000010.11,9000010.11,"AH",2)
D HRS^PXVUTIL Q
"IX",9000010.11,9000010.11,"AH",2.4)
S X=(X(1)'="")
"IX",9000010.11,9000010.11,"AH",2.5)
Q
"IX",9000010.11,9000010.11,"AH",11.1,0)
^.114IA^3^3
"IX",9000010.11,9000010.11,"AH",11.1,1,0)
1^F^9000010.11^1403^^^F
"IX",9000010.11,9000010.11,"AH",11.1,2,0)
2^F^9000010.11^1201^^^F
"IX",9000010.11,9000010.11,"AH",11.1,3,0)
3^F^9000010.11^1406^^^F
"IX",9000010.12,9000010.12,"ACR",0)
9000010.12^ACR^Clinical Reminders index.^MU^^R^IR^I^9000010.12^^^^^A
"IX",9000010.12,9000010.12,"ACR",.1,0)
^^8^8^3081110
"IX",9000010.12,9000010.12,"ACR",.1,1,0)
This cross-reference builds two indexes, one for finding
"IX",9000010.12,9000010.12,"ACR",.1,2,0)
all patients with a particular skin test and one for finding all
"IX",9000010.12,9000010.12,"ACR",.1,3,0)
the skin tests a patient has.
"IX",9000010.12,9000010.12,"ACR",.1,4,0)
The indexes are stored in the Clinical Reminders index global as:
"IX",9000010.12,9000010.12,"ACR",.1,5,0)
 ^PXRMINDX(9000010.12,"IP",SKIN TEST,DFN,VISIT DATE,DAS) and
"IX",9000010.12,9000010.12,"ACR",.1,6,0)
 ^PXRMINDX(9000010.12,"PI",DFN,SKIN TEST,VISIT DATE,DAS)
"IX",9000010.12,9000010.12,"ACR",.1,7,0)
respectively.
"IX",9000010.12,9000010.12,"ACR",.1,8,0)
For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual.
"IX",9000010.12,9000010.12,"ACR",1)
D SVFILE^PXPXRM(9000010.12,.X,.DA)
"IX",9000010.12,9000010.12,"ACR",2)
D KVFILE^PXPXRM(9000010.12,.X,.DA)
"IX",9000010.12,9000010.12,"ACR",2.5)
K ^PXRMINDX(9000010.12)
"IX",9000010.12,9000010.12,"ACR",11.1,0)
^.114IA^3^3
"IX",9000010.12,9000010.12,"ACR",11.1,1,0)
1^F^9000010.12^.01^^1^F
"IX",9000010.12,9000010.12,"ACR",11.1,2,0)
2^F^9000010.12^.02^^2^F
"IX",9000010.12,9000010.12,"ACR",11.1,3,0)
3^F^9000010.12^.03^^3^F
"IX",9000010.12,9000010.12,"AH",0)
9000010.12^AH^Hours between placement and reading^MU^^R^IR^I^9000010.12^^^^^A
"IX",9000010.12,9000010.12,"AH",.1,0)
^^3^3^3150818^
"IX",9000010.12,9000010.12,"AH",.1,1,0)
This cross reference calculates the number of hours between the EVENT 
"IX",9000010.12,9000010.12,"AH",.1,2,0)
DATE AND TIME field (#1201) and the DATE READ field (#.06) and stores 
"IX",9000010.12,9000010.12,"AH",.1,3,0)
that value in the HOURS READ POST-PLACEMENT field (#1214).
"IX",9000010.12,9000010.12,"AH",1)
D HR^PXVUTL Q
"IX",9000010.12,9000010.12,"AH",1.4)
S X=(X(1)'="")
"IX",9000010.12,9000010.12,"AH",2)
D HR^PXVUTL Q
"IX",9000010.12,9000010.12,"AH",2.4)
S X=(X(1)'="")
"IX",9000010.12,9000010.12,"AH",2.5)
Q
"IX",9000010.12,9000010.12,"AH",11.1,0)
^.114IA^3^3
"IX",9000010.12,9000010.12,"AH",11.1,1,0)
1^F^9000010.12^.06^^^F
"IX",9000010.12,9000010.12,"AH",11.1,2,0)
2^F^9000010.12^1201^^^F
"IX",9000010.12,9000010.12,"AH",11.1,3,0)
3^F^9000010.12^1214^^^F
"IX",9999999.41,9999999.41,"AC",0)
9999999.41^AC^Unique lot number, manufacturer and vaccine combination monitoring^MU^^R^IR^I^9999999.41^^^^^A
"IX",9999999.41,9999999.41,"AC",.1,0)
^^3^3^3150817^^
"IX",9999999.41,9999999.41,"AC",.1,1,0)
This cross reference is used in identifying a new lot number as unique, 
"IX",9999999.41,9999999.41,"AC",.1,2,0)
that is, the immunization name, lot number and manufacturer combination 
"IX",9999999.41,9999999.41,"AC",.1,3,0)
is unique.
"IX",9999999.41,9999999.41,"AC",1)
S ^AUTTIML("AC",X(3),X(2),X(1),DA)="" Q
"IX",9999999.41,9999999.41,"AC",1.4)
S X=(X(1)'="")
"IX",9999999.41,9999999.41,"AC",2)
K ^AUTTIML("AC",X(3),X(2),X(1),DA) Q
"IX",9999999.41,9999999.41,"AC",2.4)
S X=(X(1)'="")
"IX",9999999.41,9999999.41,"AC",2.5)
Q
"IX",9999999.41,9999999.41,"AC",11.1,0)
^.114IA^3^3
"IX",9999999.41,9999999.41,"AC",11.1,1,0)
1^F^9999999.41^.01^25^^F
"IX",9999999.41,9999999.41,"AC",11.1,2,0)
2^F^9999999.41^.02^^^F
"IX",9999999.41,9999999.41,"AC",11.1,3,0)
3^F^9999999.41^.04^^^F
"KRN",19,9862,-1)
2^1
"KRN",19,9862,0)
PXTT TABLE MAINTENANCE^PCE Table Maintenance^^M^10000000010^^^^^^^
"KRN",19,9862,10,0)
^19.01IP^16^11
"KRN",19,9862,10,16,0)
14294^LOT
"KRN",19,9862,10,16,"^")
PXTT EDIT IMMUNIZATION LOT
"KRN",19,9862,"U")
PCE TABLE MAINTENANCE
"KRN",19,14294,-1)
0^2
"KRN",19,14294,0)
PXTT EDIT IMMUNIZATION LOT^Immunization Lot Add/Edit/Display^^R^^PXV IMM INVENTORY MGR^^^^^n^^^^
"KRN",19,14294,1,0)
^19.06^2^2^3150519^^
"KRN",19,14294,1,1,0)
This option allows an authorized user to add or update an immunization
"KRN",19,14294,1,2,0)
lot.
"KRN",19,14294,15)

"KRN",19,14294,20)

"KRN",19,14294,25)
EN^PXVEDIT
"KRN",19,14294,"U")
IMMUNIZATION LOT ADD/EDIT/DISP
"KRN",19,14295,-1)
0^3
"KRN",19,14295,0)
PXVTASK-NIGHT^Immunization Expired Lot Inactivation^^R^^^^^^^^PCE PATIENT CARE ENCOUNTER
"KRN",19,14295,1,0)
^19.06^4^4^3150519^^^
"KRN",19,14295,1,1,0)
This option should be queued to run daily at 12:01 AM. This option 
"KRN",19,14295,1,2,0)
inactivates immunization inventory lots that have past their expiration 
"KRN",19,14295,1,3,0)
dates so that expired immunizations are not administered under normal 
"KRN",19,14295,1,4,0)
circumstances.
"KRN",19,14295,25)
PXVNITLY
"KRN",19,14295,"U")
IMMUNIZATION EXPIRED LOT INACT
"KRN",19.1,687,-1)
0^1
"KRN",19.1,687,0)
PXV IMM INVENTORY MGR^Immunization Inventory Manager
"KRN",19.1,687,1,0)
^19.11^2^2^3150519^^
"KRN",19.1,687,1,1,0)
This key is assigned to users responsible for immunization inventory 
"KRN",19.1,687,1,2,0)
management.
"KRN",8994,3295,-1)
0^1
"KRN",8994,3295,0)
PX SAVE DATA^SAVE^PXRPC^1^P^^^^^^1
"KRN",8994,3295,1,0)
^8994.01^3^3^3150730^^^^
"KRN",8994,3295,1,1,0)
The purpose of this RPC is to allow the calling application to save data 
"KRN",8994,3295,1,2,0)
to PCE, such as Immunization data. See the Integration Control 
"KRN",8994,3295,1,3,0)
Registration document for the full description of the data needed.
"KRN",8994,3295,2,0)
^8994.02A^4^4
"KRN",8994,3295,2,1,0)
PCELIST^2^10000^1^1
"KRN",8994,3295,2,1,1,0)
^^50^50^3150730^
"KRN",8994,3295,2,1,1,1,0)
PCELIST (n)= HDR ^ Encounter Inpatient? ^ Note has CPT codes? ^ Visit 
"KRN",8994,3295,2,1,1,2,0)
             string [Encounter location; Encounter date/time; Encounter
"KRN",8994,3295,2,1,1,3,0)
             Service category]  (REQUIRED)
"KRN",8994,3295,2,1,1,4,0)
        (n)=VST^DT^Encounter date/time
"KRN",8994,3295,2,1,1,5,0)
        (n)=VST^PT^Encounter patient (DFN) (n)=VST^HL^Encounter location
"KRN",8994,3295,2,1,1,6,0)
        (n)=VST^VC^ Encounter Service Category
"KRN",8994,3295,2,1,1,7,0)
 
"KRN",8994,3295,2,1,1,8,0)
        If  applicable:
"KRN",8994,3295,2,1,1,9,0)
              
"KRN",8994,3295,2,1,1,10,0)
        (n)=VST^PR^ Parent for secondary visit
"KRN",8994,3295,2,1,1,11,0)
        (n)=VST^OL^ Outside Location for Historical visits
"KRN",8994,3295,2,1,1,12,0)
        (n)=VST^SC^ Service Connected related?
"KRN",8994,3295,2,1,1,13,0)
        (n)=VST^AO^ Agent Orange related?
"KRN",8994,3295,2,1,1,14,0)
        (n)=VST^IR^ Ionizing Radiation related?
"KRN",8994,3295,2,1,1,15,0)
        (n)=VST^EC^ Environmental Contaminates related?
"KRN",8994,3295,2,1,1,16,0)
        (n)=VST^MST^ Military Sexual Trauma related?
"KRN",8994,3295,2,1,1,17,0)
        (n)=VST^HNC^ Head and/or Neck Cancer related?
"KRN",8994,3295,2,1,1,18,0)
        (n)=VST^CV^ Combat Vet related?
"KRN",8994,3295,2,1,1,19,0)
        (n)=VST^SHD^ Shipboard Hazard and Defense related?
"KRN",8994,3295,2,1,1,20,0)
 
"KRN",8994,3295,2,1,1,21,0)
        (n)=PRV^PRV ^ Provider IEN ^^^ Provider Name ^ Primary Provider?
"KRN",8994,3295,2,1,1,22,0)
        (n)=POV(+:  add, -: delete) ^ ICD diagnosis code ^ Category  ^ 
"KRN",8994,3295,2,1,1,23,0)
            Narrative (Diagnosis description) ^ Primary Diagnosis? ^
"KRN",8994,3295,2,1,1,24,0)
            Provider String ^ Add to Problem List? ^^^ Next comment
"KRN",8994,3295,2,1,1,25,0)
            sequence # if saving comments
"KRN",8994,3295,2,1,1,26,0)
        (n)=COM^COM (Comments) ^ Next comment sequence # ^ @ = no 
"KRN",8994,3295,2,1,1,27,0)
            comments added
"KRN",8994,3295,2,1,1,28,0)
        (n)=CPT (+:  add, -: delete) ^ Procedural  CPT code ^ Category ^ 
"KRN",8994,3295,2,1,1,29,0)
            Narrative (Procedure description) ^ Quantity ^ Provider IEN
"KRN",8994,3295,2,1,1,30,0)
            ^^^ [# of modifiers;  Modifier code/Modifier IEN ^ Next
"KRN",8994,3295,2,1,1,31,0)
            comment sequence # ^
"KRN",8994,3295,2,1,1,32,0)
        (n)=IMM (+:  add, -: delete) ^ Immunization IEN ^ Category ^ 
"KRN",8994,3295,2,1,1,33,0)
            Narrative (Immunization description/name) ^ Series ^
"KRN",8994,3295,2,1,1,34,0)
            Encounter Provider ^ Reaction ^ Contraindicated? ^ ^
"KRN",8994,3295,2,1,1,35,0)
            Next comment sequence # ^ CVX ^ Event Info Source ^ Dosage ^
"KRN",8994,3295,2,1,1,36,0)
            Route ^ Admin Site ^ Lot# ^ Manufacturer ^ Expiration Date
"KRN",8994,3295,2,1,1,37,0)
            ^ Event Date and Time ^ Ordering Provider ^ VIS IEN/VIS Date;
"KRN",8994,3295,2,1,1,38,0)
            VIS IEN n/VIS Date n ^ Remarks Start Seq #/Remarks End Seq #
"KRN",8994,3295,2,1,1,39,0)
        (n)=SK (+:  add, -: delete) ^ Skin Test IEN ^ Category ^ 
"KRN",8994,3295,2,1,1,40,0)
            Narrative (Skin Test description/name) ^ Results ^^ Reading
"KRN",8994,3295,2,1,1,41,0)
            ^^^ Next comment sequence #
"KRN",8994,3295,2,1,1,42,0)
        (n)=PED (+:  add, -: delete) ^ Patient Education IEN ^ Category ^ 
"KRN",8994,3295,2,1,1,43,0)
            Narrative (Patient Education description/name) ^ Level of
"KRN",8994,3295,2,1,1,44,0)
            understanding ^^^^^ ^^ Next comment sequence #
"KRN",8994,3295,2,1,1,45,0)
        (n)=HF (+:  add, -: delete) ^ Health Factor IEN ^ Category ^ 
"KRN",8994,3295,2,1,1,46,0)
            Narrative (Health Factor description/name) ^ Level ^^^^^ Next
"KRN",8994,3295,2,1,1,47,0)
            comment sequence # ^ Get Reminder
"KRN",8994,3295,2,1,1,48,0)
        (n)=XAM(+:  add, -: delete) ^ Exam IEN ^ Category ^ Narrative 
"KRN",8994,3295,2,1,1,49,0)
            (Exam description/name) ^ Results ^^^^^ Next comment sequence
"KRN",8994,3295,2,1,1,50,0)
            #
"KRN",8994,3295,2,2,0)
LOC^1^40^0^2
"KRN",8994,3295,2,2,1,0)
^^2^2^3140225^
"KRN",8994,3295,2,2,1,1,0)
This is the hospital location. This is not used when the information is 
"KRN",8994,3295,2,2,1,2,0)
from an outside source.
"KRN",8994,3295,2,3,0)
PKGNAME^1^60^1^3
"KRN",8994,3295,2,3,1,0)
^^2^2^3140225^
"KRN",8994,3295,2,3,1,1,0)
The package name that is sending the data to PCE. This should be the 
"KRN",8994,3295,2,3,1,2,0)
full package name, such as PATIENT CARE ENCOUNTERS. 
"KRN",8994,3295,2,4,0)
SRC^1^60^1^4
"KRN",8994,3295,2,4,1,0)
^8994.021^1^1^3150407^^^
"KRN",8994,3295,2,4,1,1,0)
The source of the data - such as VLER E-HEALTH EXCHANGE.
"KRN",8994,3295,2,"B","LOC",2)

"KRN",8994,3295,2,"B","PCELIST",1)

"KRN",8994,3295,2,"B","PKGNAME",3)

"KRN",8994,3295,2,"B","SRC",4)

"KRN",8994,3295,2,"PARAMSEQ",1,1)

"KRN",8994,3295,2,"PARAMSEQ",2,2)

"KRN",8994,3295,2,"PARAMSEQ",3,3)

"KRN",8994,3295,2,"PARAMSEQ",4,4)

"KRN",8994,3295,3,0)
^8994.03^8^8^3150407^^
"KRN",8994,3295,3,1,0)
The only return will be the one passed back to the calling application.
"KRN",8994,3295,3,2,0)
 
"KRN",8994,3295,3,3,0)
A -2 indicates that the routine PXAI found an issue even though the 
"KRN",8994,3295,3,4,0)
original input values appeared to be correct.
"KRN",8994,3295,3,5,0)
 
"KRN",8994,3295,3,6,0)
A -3 indicates that the input parameters were not properly defined.
"KRN",8994,3295,3,7,0)
 
"KRN",8994,3295,3,8,0)
A 1 indicate success.
"MBREQ")
0
"ORD",3,19.1)
19.1;3;;;KEY^XPDTA1;KEYF1^XPDIA1;KEYE1^XPDIA1;KEYF2^XPDIA1;;KEYDEL^XPDIA1
"ORD",3,19.1,0)
SECURITY KEY
"ORD",16,8994)
8994;16;1;;;;;;;RPCDEL^XPDIA1
"ORD",16,8994,0)
REMOTE PROCEDURE
"ORD",18,19)
19;18;;;OPT^XPDTA;OPTF1^XPDIA;OPTE1^XPDIA;OPTF2^XPDIA;;OPTDEL^XPDIA
"ORD",18,19,0)
OPTION
"PKG",507,-1)
1^1
"PKG",507,0)
PCE PATIENT CARE ENCOUNTER^PX^Patient Care Encounter
"PKG",507,20,0)
^9.402P^^
"PKG",507,22,0)
^9.49I^1^1
"PKG",507,22,1,0)
1.0^2960812^2960912^10958
"PKG",507,22,1,"PAH",1,0)
210^3150825
"PKG",507,22,1,"PAH",1,1,0)
^^7^7^3150825
"PKG",507,22,1,"PAH",1,1,1,0)
The Veterans Health Information Systems and Technology Architecture
"PKG",507,22,1,"PAH",1,1,2,0)
(VistA) Immunizations Enhancements (VIMM) 2.0 project, Increment 2, 
"PKG",507,22,1,"PAH",1,1,3,0)
builds upon the file structures and standardized data introduced by 
"PKG",507,22,1,"PAH",1,1,4,0)
Increment 1 by adding functional enhancements to the existing VistA 
"PKG",507,22,1,"PAH",1,1,5,0)
Patient Care Encounter (PCE) package.
"PKG",507,22,1,"PAH",1,1,6,0)
 
"PKG",507,22,1,"PAH",1,1,7,0)
See the National Patch Module for a more detailed description.
"QUES","XPF1",0)
Y
"QUES","XPF1","??")
^D REP^XPDH
"QUES","XPF1","A")
Shall I write over your |FLAG| File
"QUES","XPF1","B")
YES
"QUES","XPF1","M")
D XPF1^XPDIQ
"QUES","XPF2",0)
Y
"QUES","XPF2","??")
^D DTA^XPDH
"QUES","XPF2","A")
Want my data |FLAG| yours
"QUES","XPF2","B")
YES
"QUES","XPF2","M")
D XPF2^XPDIQ
"QUES","XPI1",0)
YO
"QUES","XPI1","??")
^D INHIBIT^XPDH
"QUES","XPI1","A")
Want KIDS to INHIBIT LOGONs during the install
"QUES","XPI1","B")
NO
"QUES","XPI1","M")
D XPI1^XPDIQ
"QUES","XPM1",0)
PO^VA(200,:EM
"QUES","XPM1","??")
^D MG^XPDH
"QUES","XPM1","A")
Enter the Coordinator for Mail Group '|FLAG|'
"QUES","XPM1","B")

"QUES","XPM1","M")
D XPM1^XPDIQ
"QUES","XPO1",0)
Y
"QUES","XPO1","??")
^D MENU^XPDH
"QUES","XPO1","A")
Want KIDS to Rebuild Menu Trees Upon Completion of Install
"QUES","XPO1","B")
YES
"QUES","XPO1","M")
D XPO1^XPDIQ
"QUES","XPZ1",0)
Y
"QUES","XPZ1","??")
^D OPT^XPDH
"QUES","XPZ1","A")
Want to DISABLE Scheduled Options, Menu Options, and Protocols
"QUES","XPZ1","B")
NO
"QUES","XPZ1","M")
D XPZ1^XPDIQ
"QUES","XPZ2",0)
Y
"QUES","XPZ2","??")
^D RTN^XPDH
"QUES","XPZ2","A")
Want to MOVE routines to other CPUs
"QUES","XPZ2","B")
NO
"QUES","XPZ2","M")
D XPZ2^XPDIQ
"RTN")
28
"RTN","PXAIIMM")
0^2^B14255138^B7183500
"RTN","PXAIIMM",1,0)
PXAIIMM ;ISL/PKR - Set the IMMUNIZATION nodes. ;08/10/15  14:44
"RTN","PXAIIMM",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**45,124,209,210**;Aug 12, 1996;Build 11
"RTN","PXAIIMM",3,0)
 ;
"RTN","PXAIIMM",4,0)
IMM ;Main entry point.
"RTN","PXAIIMM",5,0)
 ;
"RTN","PXAIIMM",6,0)
 K PXAERR
"RTN","PXAIIMM",7,0)
 S PXAERR(8)=PXAK
"RTN","PXAIIMM",8,0)
 S PXAERR(7)="IMMUNIZATION"
"RTN","PXAIIMM",9,0)
 ;
"RTN","PXAIIMM",10,0)
 N IND,PXAA
"RTN","PXAIIMM",11,0)
 S IND=""
"RTN","PXAIIMM",12,0)
 F  S IND=$O(@PXADATA@("IMMUNIZATION",PXAK,IND)) Q:IND=""  D
"RTN","PXAIIMM",13,0)
 . I IND?1(1"VIS",1"REMARKS") D  Q
"RTN","PXAIIMM",14,0)
 . . M PXAA(IND)=@PXADATA@("IMMUNIZATION",PXAK,IND)
"RTN","PXAIIMM",15,0)
 . S PXAA(IND)=@PXADATA@("IMMUNIZATION",PXAK,IND)
"RTN","PXAIIMM",16,0)
 ;
"RTN","PXAIIMM",17,0)
 ;Validate the data.
"RTN","PXAIIMM",18,0)
 N STOP
"RTN","PXAIIMM",19,0)
 D VAL^PXAIIMMV
"RTN","PXAIIMM",20,0)
 I $G(STOP) Q
"RTN","PXAIIMM",21,0)
 ;
"RTN","PXAIIMM",22,0)
SETVARA ;Set the after visit variables.
"RTN","PXAIIMM",23,0)
 N AFTER0,AFTER12,AFTER13,AFTER811,AFTER812
"RTN","PXAIIMM",24,0)
 S $P(AFTER0,U,1)=$G(PXAA("IMMUN"))
"RTN","PXAIIMM",25,0)
 I $G(PXAA("DELETE")) S $P(AFTER0,U,1)="@"
"RTN","PXAIIMM",26,0)
 S $P(AFTER0,U,2)=$G(PATIENT)
"RTN","PXAIIMM",27,0)
 S $P(AFTER0,U,3)=$G(PXAVISIT)
"RTN","PXAIIMM",28,0)
 S $P(AFTER0,U,4)=$G(PXAA("SERIES"))
"RTN","PXAIIMM",29,0)
 S $P(AFTER0,U,6)=$G(PXAA("REACTION"))
"RTN","PXAIIMM",30,0)
 S $P(AFTER0,U,7)=$G(PXAA("CONTRAINDICATED"))
"RTN","PXAIIMM",31,0)
 S $P(AFTER12,U,1)=$G(PXAA("EVENT D/T"))
"RTN","PXAIIMM",32,0)
 S $P(AFTER12,U,4)=$G(PXAA("ENC PROVIDER"))
"RTN","PXAIIMM",33,0)
 S $P(AFTER811,U,1)=$G(PXAA("COMMENT"))
"RTN","PXAIIMM",34,0)
 ;
"RTN","PXAIIMM",35,0)
 ;--PACKAGE AND SOURCE
"RTN","PXAIIMM",36,0)
 S $P(AFTER812,"^",2)=$G(PXAPKG)
"RTN","PXAIIMM",37,0)
 S $P(AFTER812,"^",3)=$G(PXASOURC)
"RTN","PXAIIMM",38,0)
 ;
"RTN","PXAIIMM",39,0)
 ;--Add new fields for VIMM 2.0 - PX*1*209
"RTN","PXAIIMM",40,0)
 S $P(AFTER12,U,2)=$G(PXAA("ORD PROVIDER"))
"RTN","PXAIIMM",41,0)
 S $P(AFTER12,U,7)=$G(PXAA("LOT NUM"))
"RTN","PXAIIMM",42,0)
 S $P(AFTER13,U)=$G(PXAA("INFO SOURCE"))
"RTN","PXAIIMM",43,0)
 S $P(AFTER13,U,2)=$G(PXAA("ADMIN ROUTE"))
"RTN","PXAIIMM",44,0)
 S $P(AFTER13,U,3)=$G(PXAA("ANATOMIC LOC"))
"RTN","PXAIIMM",45,0)
 S $P(AFTER13,U,4)=$G(PXAA("DIAGNOSIS"))
"RTN","PXAIIMM",46,0)
 S $P(AFTER13,U,12)=$G(PXAA("DOSE"))
"RTN","PXAIIMM",47,0)
 S $P(AFTER13,U,13)=$G(PXAA("DOSE UNITS"))
"RTN","PXAIIMM",48,0)
 ;
"RTN","PXAIIMM",49,0)
 S ^TMP("PXK",$J,"IMM",PXAK,0,"AFTER")=AFTER0
"RTN","PXAIIMM",50,0)
 S ^TMP("PXK",$J,"IMM",PXAK,12,"AFTER")=AFTER12
"RTN","PXAIIMM",51,0)
 S ^TMP("PXK",$J,"IMM",PXAK,13,"AFTER")=AFTER13
"RTN","PXAIIMM",52,0)
 S ^TMP("PXK",$J,"IMM",PXAK,811,"AFTER")=AFTER811
"RTN","PXAIIMM",53,0)
 S ^TMP("PXK",$J,"IMM",PXAK,812,"AFTER")=AFTER812
"RTN","PXAIIMM",54,0)
 ;
"RTN","PXAIIMM",55,0)
 ; Add multiple data to PXK AFTER - PX*1*210
"RTN","PXAIIMM",56,0)
 N FLD,SEQ,SUB
"RTN","PXAIIMM",57,0)
 ;
"RTN","PXAIIMM",58,0)
 F FLD="VIS","REMARKS" D
"RTN","PXAIIMM",59,0)
 . ;
"RTN","PXAIIMM",60,0)
 . S SUB=$S(FLD="VIS":2,1:11)
"RTN","PXAIIMM",61,0)
 . ;
"RTN","PXAIIMM",62,0)
 . ; Delete multiple
"RTN","PXAIIMM",63,0)
 . I $G(PXAA(FLD))="@" D  Q
"RTN","PXAIIMM",64,0)
 . . S ^TMP("PXK",$J,"IMM",PXAK,SUB,0,"AFTER")="@"
"RTN","PXAIIMM",65,0)
 . ;
"RTN","PXAIIMM",66,0)
 . S SEQ=0
"RTN","PXAIIMM",67,0)
 . F  S SEQ=$O(PXAA(FLD,SEQ)) Q:'SEQ  D
"RTN","PXAIIMM",68,0)
 . . S ^TMP("PXK",$J,"IMM",PXAK,SUB,SEQ,"AFTER")=$G(PXAA(FLD,SEQ,0))
"RTN","PXAIIMM",69,0)
 ;
"RTN","PXAIIMM",70,0)
 ; Add DIAGNOSIS 2 thru 8 to OTHER DIAGNOSIS multiple
"RTN","PXAIIMM",71,0)
 N DIAGNUM,DIAGSTR
"RTN","PXAIIMM",72,0)
 ;
"RTN","PXAIIMM",73,0)
 S SEQ=0
"RTN","PXAIIMM",74,0)
 ;
"RTN","PXAIIMM",75,0)
 F DIAGNUM=2:1:8 D
"RTN","PXAIIMM",76,0)
 . S DIAGSTR="DIAGNOSIS "_DIAGNUM
"RTN","PXAIIMM",77,0)
 . I $G(PXAA(DIAGSTR))'="" D
"RTN","PXAIIMM",78,0)
 . . S SEQ=SEQ+1
"RTN","PXAIIMM",79,0)
 . . S ^TMP("PXK",$J,"IMM",PXAK,3,SEQ,"AFTER")=PXAA(DIAGSTR)
"RTN","PXAIIMM",80,0)
 ;
"RTN","PXAIIMM",81,0)
SETVARB ;Set the before variables.
"RTN","PXAIIMM",82,0)
 N BEFOR0,BEFOR12,BEFOR13,BEFOR811,BEFOR812
"RTN","PXAIIMM",83,0)
 N IENB,PXAAX,PXBCNT,PXBKY,PXBSKY,PXBSAM
"RTN","PXAIIMM",84,0)
 D IMM^PXBGIMM(PXAVISIT)
"RTN","PXAIIMM",85,0)
 ;
"RTN","PXAIIMM",86,0)
 S IENB=""
"RTN","PXAIIMM",87,0)
 I PXBCNT>0 D
"RTN","PXAIIMM",88,0)
 . S PXAAX("IMMUN")=$P($G(^AUTTIMM(PXAA("IMMUN"),0)),U,1)
"RTN","PXAIIMM",89,0)
 . S IENB=$O(PXBKY(PXAAX("IMMUN"),IENB))
"RTN","PXAIIMM",90,0)
 I $G(IENB) D
"RTN","PXAIIMM",91,0)
 . S BEFOR0=$G(^AUPNVIMM(IENB,0))
"RTN","PXAIIMM",92,0)
 . S BEFOR12=$G(^AUPNVIMM(IENB,12))
"RTN","PXAIIMM",93,0)
 . S BEFOR13=$G(^AUPNVIMM(IENB,13))
"RTN","PXAIIMM",94,0)
 . S BEFOR811=$G(^AUPNVIMM(IENB,811))
"RTN","PXAIIMM",95,0)
 . S BEFOR812=$G(^AUPNVIMM(IENB,812))
"RTN","PXAIIMM",96,0)
 E  S (BEFOR0,BEFOR11,BEFOR12,BEFOR13,BEFOR811,BEFOR812)=""
"RTN","PXAIIMM",97,0)
 ;
"RTN","PXAIIMM",98,0)
 S ^TMP("PXK",$J,"IMM",PXAK,0,"BEFORE")=BEFOR0
"RTN","PXAIIMM",99,0)
 S ^TMP("PXK",$J,"IMM",PXAK,12,"BEFORE")=BEFOR12
"RTN","PXAIIMM",100,0)
 S ^TMP("PXK",$J,"IMM",PXAK,13,"BEFORE")=BEFOR13
"RTN","PXAIIMM",101,0)
 S ^TMP("PXK",$J,"IMM",PXAK,811,"BEFORE")=BEFOR811
"RTN","PXAIIMM",102,0)
 S ^TMP("PXK",$J,"IMM",PXAK,812,"BEFORE")=BEFOR812
"RTN","PXAIIMM",103,0)
 S ^TMP("PXK",$J,"IMM",PXAK,"IEN")=IENB
"RTN","PXAIIMM",104,0)
 ;
"RTN","PXAIIMM",105,0)
 ; Add multiple data to PXK BEFORE
"RTN","PXAIIMM",106,0)
 I $G(IENB) D
"RTN","PXAIIMM",107,0)
 . N IENSUB,SUB
"RTN","PXAIIMM",108,0)
 . F SUB=2,3,11 D
"RTN","PXAIIMM",109,0)
 . . S IENSUB=0
"RTN","PXAIIMM",110,0)
 . . F  S IENSUB=$O(^AUPNVIMM(IENB,SUB,IENSUB)) Q:'IENSUB  D
"RTN","PXAIIMM",111,0)
 . . . S ^TMP("PXK",$J,"IMM",PXAK,SUB,IENSUB,"BEFORE")=$G(^AUPNVIMM(IENB,SUB,IENSUB,0))
"RTN","PXAIIMM",112,0)
 ;
"RTN","PXAIIMM",113,0)
 Q
"RTN","PXAIIMMV")
0^3^B19623180^B4109825
"RTN","PXAIIMMV",1,0)
PXAIIMMV ;ISL/PKR - VALIDATE IMMUNIZATION DATA ;08/19/15  16:19
"RTN","PXAIIMMV",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**199,209,210**;Aug 12, 1996;Build 11
"RTN","PXAIIMMV",3,0)
 ;
"RTN","PXAIIMMV",4,0)
VAL ;Make sure the required field is present.
"RTN","PXAIIMMV",5,0)
 I '$D(PXAA("IMMUN")) D  Q:$G(STOP)=1
"RTN","PXAIIMMV",6,0)
 . S STOP=1
"RTN","PXAIIMMV",7,0)
 . S PXAERRF=1
"RTN","PXAIIMMV",8,0)
 . S PXADI("DIALOG")=8390001.001
"RTN","PXAIIMMV",9,0)
 . S PXAERR(9)="IMMUNIZATION"
"RTN","PXAIIMMV",10,0)
 . S PXAERR(10)="AFTER"
"RTN","PXAIIMMV",11,0)
 . S PXAERR(11)=$G(PXAA("IMMUNIZATION"))
"RTN","PXAIIMMV",12,0)
 . S PXAERR(12)="You are missing the name of the immunization"
"RTN","PXAIIMMV",13,0)
 Q:$G(PXAA("DELETE"))=1  ; don't bother checking diagnoses if this is a deletion
"RTN","PXAIIMMV",14,0)
 ; confirm valid diagnosis pointers
"RTN","PXAIIMMV",15,0)
 N DIAGNUM,DIAGSTR,ICDDATA,PXDXDATE
"RTN","PXAIIMMV",16,0)
 S PXDXDATE=$$CSDATE^PXDXUTL(PXAVISIT)
"RTN","PXAIIMMV",17,0)
 F DIAGNUM=1:1:8 D  Q:$G(STOP)=1
"RTN","PXAIIMMV",18,0)
 . S DIAGSTR="DIAGNOSIS"_$S(DIAGNUM>1:" "_DIAGNUM,1:"")
"RTN","PXAIIMMV",19,0)
 . I $G(PXAA(DIAGSTR))]"" D
"RTN","PXAIIMMV",20,0)
 .. S ICDDATA=$$ICDDATA^ICDXCODE("DIAG",$G(PXAA(DIAGSTR)),PXDXDATE,"I")
"RTN","PXAIIMMV",21,0)
 .. I $P(ICDDATA,"^",1)'>0 D  Q:$G(STOP)=1
"RTN","PXAIIMMV",22,0)
 ... S STOP=1
"RTN","PXAIIMMV",23,0)
 ... S PXAERRF=1
"RTN","PXAIIMMV",24,0)
 ... S PXADI("DIALOG")=8390001.001
"RTN","PXAIIMMV",25,0)
 ... S PXAERR(9)="IMMUNIZATION"
"RTN","PXAIIMMV",26,0)
 ... S PXAERR(10)="AFTER"
"RTN","PXAIIMMV",27,0)
 ... S PXAERR(11)=$G(PXAA(DIAGSTR))
"RTN","PXAIIMMV",28,0)
 ... S PXAERR(12)="IMMUNIZATION DIAGNOSIS #"_DIAGNUM_" ("_PXAERR(11)_") is NOT a valid pointer value to the ICD DIAGNOSIS FILE #80"
"RTN","PXAIIMMV",29,0)
 .. I $P(ICDDATA,"^",10)'=1 D  Q:$G(STOP)=1
"RTN","PXAIIMMV",30,0)
 ... S STOP=1
"RTN","PXAIIMMV",31,0)
 ... S PXAERRF=1
"RTN","PXAIIMMV",32,0)
 ... S PXADI("DIALOG")=8390001.001
"RTN","PXAIIMMV",33,0)
 ... S PXAERR(9)="IMMUNIZATION"
"RTN","PXAIIMMV",34,0)
 ... S PXAERR(10)="AFTER"
"RTN","PXAIIMMV",35,0)
 ... S PXAERR(11)=$G(PXAA(DIAGSTR))
"RTN","PXAIIMMV",36,0)
 ... S PXAERR(12)="IMMUNIZATION DIAGNOSIS #"_DIAGNUM_" ("_PXAERR(11)_") is NOT an Active ICD code"
"RTN","PXAIIMMV",37,0)
 ;
"RTN","PXAIIMMV",38,0)
 ; Validate VIMM 2.0 fields
"RTN","PXAIIMMV",39,0)
 N PXFLD,PXFLDNAME,PXFLDNUM,PXVAL,PXFILE,PXOK,PXNEWVAL,PXSEQ,PXVIS
"RTN","PXAIIMMV",40,0)
 ;
"RTN","PXAIIMMV",41,0)
 F PXFLD="SERIES^.04","LOT NUM^1207","INFO SOURCE^1301","ADMIN ROUTE^1302","ANATOMIC LOC^1303","ORD PROVIDER^1202","DOSE UNITS^1313" D
"RTN","PXAIIMMV",42,0)
 . ;
"RTN","PXAIIMMV",43,0)
 . S PXFLDNAME=$P(PXFLD,"^",1)
"RTN","PXAIIMMV",44,0)
 . S PXFLDNUM=$P(PXFLD,"^",2)
"RTN","PXAIIMMV",45,0)
 . ;
"RTN","PXAIIMMV",46,0)
 . S PXVAL=$G(PXAA(PXFLDNAME))
"RTN","PXAIIMMV",47,0)
 . I PXVAL="" Q
"RTN","PXAIIMMV",48,0)
 . ;
"RTN","PXAIIMMV",49,0)
 . S PXFILE=9000010.11
"RTN","PXAIIMMV",50,0)
 . S PXOK=$$VALFLD(PXFILE,PXFLDNUM,PXVAL)
"RTN","PXAIIMMV",51,0)
 . I PXOK D
"RTN","PXAIIMMV",52,0)
 . . S PXNEWVAL=$P(PXOK,"^",2)
"RTN","PXAIIMMV",53,0)
 . . I PXNEWVAL'="" S PXAA(PXFLDNAME)=PXNEWVAL
"RTN","PXAIIMMV",54,0)
 . I 'PXOK D
"RTN","PXAIIMMV",55,0)
 . . D ERRMSG(8390001.002,0,PXVAL,PXFLDNAME)
"RTN","PXAIIMMV",56,0)
 . . K PXAA(PXFLDNAME) ; Don't file this field, as it's invalid
"RTN","PXAIIMMV",57,0)
 ;
"RTN","PXAIIMMV",58,0)
 ; Check VIS Multiple
"RTN","PXAIIMMV",59,0)
 S PXFLDNAME="VIS"
"RTN","PXAIIMMV",60,0)
 S PXFLDNUM=.01
"RTN","PXAIIMMV",61,0)
 ;
"RTN","PXAIIMMV",62,0)
 I $G(PXAA(PXFLDNAME))="@" Q
"RTN","PXAIIMMV",63,0)
 ;
"RTN","PXAIIMMV",64,0)
 S PXSEQ=0
"RTN","PXAIIMMV",65,0)
 F  S PXSEQ=$O(PXAA(PXFLDNAME,PXSEQ)) Q:'PXSEQ  D
"RTN","PXAIIMMV",66,0)
 . ;
"RTN","PXAIIMMV",67,0)
 . S PXVAL=$P($G(PXAA(PXFLDNAME,PXSEQ,0)),U,1)
"RTN","PXAIIMMV",68,0)
 . I PXVAL="" K PXAA(PXFLDNAME,PXSEQ) Q
"RTN","PXAIIMMV",69,0)
 . ;
"RTN","PXAIIMMV",70,0)
 . S PXFILE=9000010.112
"RTN","PXAIIMMV",71,0)
 . S PXOK=$$VALFLD(PXFILE,PXFLDNUM,PXVAL)
"RTN","PXAIIMMV",72,0)
 . I 'PXOK D
"RTN","PXAIIMMV",73,0)
 . . D ERRMSG(8390001.002,0,PXVAL,PXFLDNAME)
"RTN","PXAIIMMV",74,0)
 . . K PXAA(PXFLDNAME,PXSEQ) ; Don't file this field, as it's invalid
"RTN","PXAIIMMV",75,0)
 ;
"RTN","PXAIIMMV",76,0)
 Q
"RTN","PXAIIMMV",77,0)
 ;
"RTN","PXAIIMMV",78,0)
VALFLD(PXFILE,PXFLDNUM,PXVAL) ;
"RTN","PXAIIMMV",79,0)
 ;
"RTN","PXAIIMMV",80,0)
 ; Validate field and return:
"RTN","PXAIIMMV",81,0)
 ;
"RTN","PXAIIMMV",82,0)
 ;    1   - Field is valid
"RTN","PXAIIMMV",83,0)
 ;    1^X - Field is valid, but was external value.
"RTN","PXAIIMMV",84,0)
 ;          The function will return the internal
"RTN","PXAIIMMV",85,0)
 ;          value in the 2nd piece (X).
"RTN","PXAIIMMV",86,0)
 ;    0   - Field is invalid
"RTN","PXAIIMMV",87,0)
 ;
"RTN","PXAIIMMV",88,0)
 N PXOK,PXEXT,PXCODES,PXI,PXX,PXCODE,PXCODEVAL,PXTEMP
"RTN","PXAIIMMV",89,0)
 ;
"RTN","PXAIIMMV",90,0)
 S PXOK=1
"RTN","PXAIIMMV",91,0)
 ;
"RTN","PXAIIMMV",92,0)
 I PXVAL="@" Q PXOK
"RTN","PXAIIMMV",93,0)
 ;
"RTN","PXAIIMMV",94,0)
 S PXEXT=$$EXTERNAL^DILFD(PXFILE,PXFLDNUM,,PXVAL,"PXERR")  ;using this to get around input transform
"RTN","PXAIIMMV",95,0)
 I PXFILE=9000010.11,PXFLDNUM=1313 D
"RTN","PXAIIMMV",96,0)
 . N PXRSLT,PXERR
"RTN","PXAIIMMV",97,0)
 . D CHK^DIE(PXFILE,PXFLDNUM,"E","`"_PXVAL,.PXRSLT,"PXERR")
"RTN","PXAIIMMV",98,0)
 . S PXEXT=$G(PXRSLT(0))
"RTN","PXAIIMMV",99,0)
 . I $G(PXRSLT)="^" S PXEXT=""
"RTN","PXAIIMMV",100,0)
 S PXOK=(PXEXT'="")
"RTN","PXAIIMMV",101,0)
 ;
"RTN","PXAIIMMV",102,0)
 ; If value is not valid, and field is set-of-codes,
"RTN","PXAIIMMV",103,0)
 ; check to see if external value was passed in.
"RTN","PXAIIMMV",104,0)
 ; If that was the case, set PXOK to 1,
"RTN","PXAIIMMV",105,0)
 ; and return internal value in 2nd piece of PXOK
"RTN","PXAIIMMV",106,0)
 I 'PXOK,($$GET1^DID(PXFILE,PXFLDNUM,,"TYPE",,"PXERR")="SET") D
"RTN","PXAIIMMV",107,0)
 . S PXCODES=$$GET1^DID(PXFILE,PXFLDNUM,,"POINTER",,"PXERR")
"RTN","PXAIIMMV",108,0)
 . F PXI=1:1:$L(PXCODES,";") D
"RTN","PXAIIMMV",109,0)
 . . S PXX=$P(PXCODES,";",PXI)
"RTN","PXAIIMMV",110,0)
 . . S PXCODE=$P(PXX,":",1)
"RTN","PXAIIMMV",111,0)
 . . S PXCODEVAL=$P(PXX,":",2)
"RTN","PXAIIMMV",112,0)
 . . I PXCODE=""!(PXCODEVAL="") Q
"RTN","PXAIIMMV",113,0)
 . . S PXTEMP(PXCODEVAL)=PXCODE
"RTN","PXAIIMMV",114,0)
 . S PXCODE=$G(PXTEMP(PXVAL))
"RTN","PXAIIMMV",115,0)
 . I PXCODE'="" S PXOK="1^"_PXCODE
"RTN","PXAIIMMV",116,0)
 ;
"RTN","PXAIIMMV",117,0)
 Q PXOK
"RTN","PXAIIMMV",118,0)
 ;
"RTN","PXAIIMMV",119,0)
ERRMSG(PXDLG,PXSTOP,PXVAL,PXFLDNAME) ;
"RTN","PXAIIMMV",120,0)
 ;
"RTN","PXAIIMMV",121,0)
 S STOP=$G(PXSTOP,0)
"RTN","PXAIIMMV",122,0)
 S PXAERRF=1
"RTN","PXAIIMMV",123,0)
 S PXADI("DIALOG")=$G(PXDLG,"8390001.002")
"RTN","PXAIIMMV",124,0)
 I $G(PXAERR(9))'="" D
"RTN","PXAIIMMV",125,0)
 . S PXAERR(9)=PXAERR(9)_", "
"RTN","PXAIIMMV",126,0)
 . S PXAERR(11)=PXAERR(11)_", "
"RTN","PXAIIMMV",127,0)
 . S PXAERR(12)=PXAERR(12)_" "
"RTN","PXAIIMMV",128,0)
 S PXAERR(9)=$G(PXAERR(9))_PXFLDNAME
"RTN","PXAIIMMV",129,0)
 S PXAERR(11)=$G(PXAERR(11))_PXVAL
"RTN","PXAIIMMV",130,0)
 S PXAERR(12)=$G(PXAERR(12))_"'"_PXVAL_"' is not a valid value for field "_PXFLDNAME_"."
"RTN","PXAIIMMV",131,0)
 ;
"RTN","PXAIIMMV",132,0)
 Q
"RTN","PXAISK")
0^16^B12663115^B6962384
"RTN","PXAISK",1,0)
PXAISK ;ISL/PKR - Set the SKIN TEST nodes. ;07/29/2015
"RTN","PXAISK",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**45,124,210**;Aug 12, 1996;Build 11
"RTN","PXAISK",3,0)
 ;
"RTN","PXAISK",4,0)
SKIN ;Main entry point.
"RTN","PXAISK",5,0)
 ;
"RTN","PXAISK",6,0)
 K PXAERR
"RTN","PXAISK",7,0)
 S PXAERR(8)=PXAK
"RTN","PXAISK",8,0)
 S PXAERR(7)="SKIN TEST"
"RTN","PXAISK",9,0)
 ;
"RTN","PXAISK",10,0)
 N IND,PXAA
"RTN","PXAISK",11,0)
 S IND=""
"RTN","PXAISK",12,0)
 F  S IND=$O(@PXADATA@("SKIN TEST",PXAK,IND)) Q:IND=""  D
"RTN","PXAISK",13,0)
 . S PXAA(IND)=@PXADATA@("SKIN TEST",PXAK,IND)
"RTN","PXAISK",14,0)
 ;
"RTN","PXAISK",15,0)
 ;Validate the data.
"RTN","PXAISK",16,0)
 N STOP
"RTN","PXAISK",17,0)
 D VAL^PXAISKV
"RTN","PXAISK",18,0)
 I $G(STOP) Q
"RTN","PXAISK",19,0)
 ;
"RTN","PXAISK",20,0)
SETVARA ;Set the after visit variables.
"RTN","PXAISK",21,0)
 N AFTER0,AFTER12,AFTER13,AFTER80,AFTER811,AFTER812 ; modified by PX*1*210
"RTN","PXAISK",22,0)
 S $P(AFTER0,U,1)=$G(PXAA("TEST"))
"RTN","PXAISK",23,0)
 I $G(PXAA("DELETE")) S $P(AFTER0,U,1)="@"
"RTN","PXAISK",24,0)
 S $P(AFTER0,U,2)=$G(PATIENT)
"RTN","PXAISK",25,0)
 S $P(AFTER0,U,3)=$G(PXAVISIT)
"RTN","PXAISK",26,0)
 S $P(AFTER0,U,4)=$G(PXAA("RESULT"))
"RTN","PXAISK",27,0)
 S $P(AFTER0,U,5)=$G(PXAA("READING"))
"RTN","PXAISK",28,0)
 S $P(AFTER0,U,6)=$G(PXAA("D/T READ"))
"RTN","PXAISK",29,0)
 S $P(AFTER0,U,7)=$G(PXAA("READER")) ; PX*1*210
"RTN","PXAISK",30,0)
 S $P(AFTER80,U,1)=$G(PXAA("DIAGNOSIS")) ; modified by PX*1*210
"RTN","PXAISK",31,0)
 S $P(AFTER80,U,2)=$G(PXAA("DIAGNOSIS 2")) ; modified by PX*1*210
"RTN","PXAISK",32,0)
 S $P(AFTER80,U,3)=$G(PXAA("DIAGNOSIS 3")) ; modified by PX*1*210
"RTN","PXAISK",33,0)
 S $P(AFTER80,U,4)=$G(PXAA("DIAGNOSIS 4")) ; modified by PX*1*210
"RTN","PXAISK",34,0)
 S $P(AFTER80,U,5)=$G(PXAA("DIAGNOSIS 5")) ; modified by PX*1*210
"RTN","PXAISK",35,0)
 S $P(AFTER80,U,6)=$G(PXAA("DIAGNOSIS 6")) ; modified by PX*1*210
"RTN","PXAISK",36,0)
 S $P(AFTER80,U,7)=$G(PXAA("DIAGNOSIS 7")) ; modified by PX*1*210
"RTN","PXAISK",37,0)
 S $P(AFTER80,U,8)=$G(PXAA("DIAGNOSIS 8")) ; modified by PX*1*210
"RTN","PXAISK",38,0)
 S $P(AFTER12,U,1)=$G(PXAA("EVENT D/T"))
"RTN","PXAISK",39,0)
 S $P(AFTER12,U,2)=$G(PXAA("ORD PROVIDER")) ; PX*1*210
"RTN","PXAISK",40,0)
 S $P(AFTER12,U,4)=$G(PXAA("ENC PROVIDER"))
"RTN","PXAISK",41,0)
 S $P(AFTER12,U,11)=$G(PXAA("D/T PLACEMENT RECORDED")) ; PX*1*210
"RTN","PXAISK",42,0)
 S $P(AFTER12,U,12)=$G(PXAA("ANATOMIC LOC")) ; PX*1*210
"RTN","PXAISK",43,0)
 S $P(AFTER12,U,20)=$G(PXAA("D/T READING RECORDED")) ; PX*1*210
"RTN","PXAISK",44,0)
 S $P(AFTER13,U,1)=$G(PXAA("READING COMMENT")) ; PX*1*210
"RTN","PXAISK",45,0)
 S $P(AFTER811,U,1)=$G(PXAA("COMMENT"))
"RTN","PXAISK",46,0)
 ;
"RTN","PXAISK",47,0)
 ;--PACKAGE AND SOURCE
"RTN","PXAISK",48,0)
 S $P(AFTER812,"^",2)=$G(PXAPKG)
"RTN","PXAISK",49,0)
 S $P(AFTER812,"^",3)=$G(PXASOURC)
"RTN","PXAISK",50,0)
 ;
"RTN","PXAISK",51,0)
 S ^TMP("PXK",$J,"SK",PXAK,0,"AFTER")=AFTER0
"RTN","PXAISK",52,0)
 S ^TMP("PXK",$J,"SK",PXAK,12,"AFTER")=AFTER12
"RTN","PXAISK",53,0)
 S ^TMP("PXK",$J,"SK",PXAK,13,"AFTER")=AFTER13 ; PX*1*210
"RTN","PXAISK",54,0)
 S ^TMP("PXK",$J,"SK",PXAK,80,"AFTER")=AFTER80 ; PX*1*210
"RTN","PXAISK",55,0)
 S ^TMP("PXK",$J,"SK",PXAK,811,"AFTER")=AFTER811
"RTN","PXAISK",56,0)
 S ^TMP("PXK",$J,"SK",PXAK,812,"AFTER")=AFTER812
"RTN","PXAISK",57,0)
 ;
"RTN","PXAISK",58,0)
SETVARB ;Set the before variables.
"RTN","PXAISK",59,0)
 N BEFOR0,BEFOR12,BEFOR13,BEFOR80,BEFOR811,BEFOR812 ; modified by PX*1*210
"RTN","PXAISK",60,0)
 N IENB,PXAAX,PXBCNT,PXBKY,PXBSKY,PXBSAM
"RTN","PXAISK",61,0)
 D SK^PXBGSK(PXAVISIT)
"RTN","PXAISK",62,0)
 ;
"RTN","PXAISK",63,0)
 S IENB=""
"RTN","PXAISK",64,0)
 I PXBCNT>0 D
"RTN","PXAISK",65,0)
 . S PXAAX("TEST")=$P($G(^AUTTSK(PXAA("TEST"),0)),U,1)
"RTN","PXAISK",66,0)
 . S IENB=$O(PXBKY(PXAAX("TEST"),IENB))
"RTN","PXAISK",67,0)
 I $G(IENB) D
"RTN","PXAISK",68,0)
 . S BEFOR0=$G(^AUPNVSK(IENB,0))
"RTN","PXAISK",69,0)
 . S BEFOR12=$G(^AUPNVSK(IENB,12))
"RTN","PXAISK",70,0)
 . S BEFOR13=$G(^AUPNVSK(IENB,13)) ; PX*1*210
"RTN","PXAISK",71,0)
 . S BEFOR80=$G(^AUPNVSK(IENB,80)) ; PX*1*210
"RTN","PXAISK",72,0)
 . S BEFOR811=$G(^AUPNVSK(IENB,811))
"RTN","PXAISK",73,0)
 . S BEFOR812=$G(^AUPNVSK(IENB,812))
"RTN","PXAISK",74,0)
 E  S (BEFOR0,BEFOR11,BEFOR12,BEFOR13,BEFOR811,BEFOR812)="" ; modified by PX*1*210
"RTN","PXAISK",75,0)
 ;
"RTN","PXAISK",76,0)
 S ^TMP("PXK",$J,"SK",PXAK,0,"BEFORE")=BEFOR0
"RTN","PXAISK",77,0)
 S ^TMP("PXK",$J,"SK",PXAK,12,"BEFORE")=BEFOR12
"RTN","PXAISK",78,0)
 S ^TMP("PXK",$J,"SK",PXAK,13,"BEFORE")=BEFOR13 ; PX*1*210
"RTN","PXAISK",79,0)
 S ^TMP("PXK",$J,"SK",PXAK,80,"BEFORE")=BEFOR80 ; PX*1*210
"RTN","PXAISK",80,0)
 S ^TMP("PXK",$J,"SK",PXAK,811,"BEFORE")=BEFOR811
"RTN","PXAISK",81,0)
 S ^TMP("PXK",$J,"SK",PXAK,812,"BEFORE")=BEFOR812
"RTN","PXAISK",82,0)
 S ^TMP("PXK",$J,"SK",PXAK,"IEN")=IENB
"RTN","PXAISK",83,0)
 ;
"RTN","PXAISK",84,0)
 Q
"RTN","PXAPI")
0^11^B38904536^B37240429
"RTN","PXAPI",1,0)
PXAPI ;ISL/dee - PCE's APIs ;06/30/15  10:24
"RTN","PXAPI",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**15,14,27,28,124,164,210**;Aug 12, 1996;Build 11
"RTN","PXAPI",3,0)
 Q
"RTN","PXAPI",4,0)
 ;
"RTN","PXAPI",5,0)
PROVNARR(PXPNAR,PXFILE,PXCLEX) ;Convert external Provider Narrative to internal.
"RTN","PXAPI",6,0)
 ;Input:
"RTN","PXAPI",7,0)
 ;  PXPNAR    Is the text of the provider narrative.
"RTN","PXAPI",8,0)
 ;  PXFILE  Is the file that the returned pointer will be stored in.
"RTN","PXAPI",9,0)
 ;              If a new entry is created then this tells the context
"RTN","PXAPI",10,0)
 ;              that it was created under by the file using it.
"RTN","PXAPI",11,0)
 ;  PXCLEX  Is and optional pointer to the Lexicon for this narrative.
"RTN","PXAPI",12,0)
 ;
"RTN","PXAPI",13,0)
 ;Returns:
"RTN","PXAPI",14,0)
 ;  Pointer to the provider narrative file ^ narrative
"RTN","PXAPI",15,0)
 ;  or pointer to the provider narrative file ^ narrative ^1
"RTN","PXAPI",16,0)
 ;    where 1 indicates that the entry has just been added
"RTN","PXAPI",17,0)
 ;  or -1 if was unsuccessful.
"RTN","PXAPI",18,0)
 ;
"RTN","PXAPI",19,0)
 N DIC,Y,DLAYGO,DD,DO,DA
"RTN","PXAPI",20,0)
 S DIC="^AUTNPOV(",DIC(0)="L",DLAYGO=9999999.27
"RTN","PXAPI",21,0)
 S (DA,Y)=0
"RTN","PXAPI",22,0)
 S X=$E(PXPNAR,1,245)
"RTN","PXAPI",23,0)
 Q:X="" -1
"RTN","PXAPI",24,0)
 L +^AUTNPOV(0):60
"RTN","PXAPI",25,0)
 E  W !,"The Provider Narrative is LOCKED try again." Q -1
"RTN","PXAPI",26,0)
 F  S DA=$O(^AUTNPOV("B",$E(X,1,30),DA)) Q:DA'>0  I $P(^AUTNPOV(DA,0),"^")=X S Y=DA_"^"_X Q
"RTN","PXAPI",27,0)
 I '(+Y) D
"RTN","PXAPI",28,0)
 . K DA,Y
"RTN","PXAPI",29,0)
 . D FILE^DICN
"RTN","PXAPI",30,0)
 . I +Y>0,($G(PXCLEX)!$G(PXFILE)) S ^AUTNPOV(+Y,757)=$G(PXCLEX)_"^"_$G(PXFILE)
"RTN","PXAPI",31,0)
 L -^AUTNPOV(0)
"RTN","PXAPI",32,0)
 Q $S(+Y>0:Y,1:-1)
"RTN","PXAPI",33,0)
 ;
"RTN","PXAPI",34,0)
STOPCODE(PXASTOP,PXAPAT,PXADATE) ;This is the function call to return the quantity
"RTN","PXAPI",35,0)
 ;                  of a particular Stop Code for a patient on one day.
"RTN","PXAPI",36,0)
 ;Input
"RTN","PXAPI",37,0)
 ;  PXASTOP  (required) pointer to #40.7
"RTN","PXAPI",38,0)
 ;  PXAPAT   (required) pointer to #2
"RTN","PXAPI",39,0)
 ;  PXADATE  (required) the date in Fileman format
"RTN","PXAPI",40,0)
 ;                     (time is ignored if passed)
"RTN","PXAPI",41,0)
 ;Returns
"RTN","PXAPI",42,0)
 ;  the count of how many of that stop code are stored for that one day
"RTN","PXAPI",43,0)
 ;
"RTN","PXAPI",44,0)
 N PXAVST,PXREVDAT,PXENDDAT,PXACOUNT
"RTN","PXAPI",45,0)
 S PXASTOP=$G(PXASTOP)
"RTN","PXAPI",46,0)
 S PXAPAT=+$G(PXAPAT)
"RTN","PXAPI",47,0)
 S PXADATE=+$G(PXADATE)
"RTN","PXAPI",48,0)
 S (PXACOUNT,PXAVST)=0
"RTN","PXAPI",49,0)
 S PXREVDAT=9999999-$P(PXADATE,".")-.00000001
"RTN","PXAPI",50,0)
 S PXENDDAT=PXREVDAT+.9
"RTN","PXAPI",51,0)
 F  S PXREVDAT=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT)) Q:'PXREVDAT!(PXREVDAT>PXENDDAT)  D
"RTN","PXAPI",52,0)
 . F  S PXAVST=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT,PXAVST)) Q:'PXAVST  D
"RTN","PXAPI",53,0)
 .. I PXASTOP=$P(^AUPNVSIT(PXAVST,0),"^",8),"E"'=$P(^AUPNVSIT(PXAVST,0),"^",7) S PXACOUNT=PXACOUNT+1
"RTN","PXAPI",54,0)
 Q PXACOUNT
"RTN","PXAPI",55,0)
 ;
"RTN","PXAPI",56,0)
CPT(PXACPT,PXAPAT,PXADATE,PXAHLOC) ;This is the function call to return the quantity
"RTN","PXAPI",57,0)
 ;                  of a particular CPT for a patient on one day and for
"RTN","PXAPI",58,0)
 ;                  one hospital location if passed.
"RTN","PXAPI",59,0)
 ;Input
"RTN","PXAPI",60,0)
 ;  PXACPT  (required) pointer to #81
"RTN","PXAPI",61,0)
 ;  PXAPAT   (required) pointer to #2
"RTN","PXAPI",62,0)
 ;  PXADATE  (required) the date in Fileman format
"RTN","PXAPI",63,0)
 ;                     (time is ignored if passed)
"RTN","PXAPI",64,0)
 ;  PXAHLOC  (optional) pointer to #44
"RTN","PXAPI",65,0)
 ;Returns
"RTN","PXAPI",66,0)
 ;  the count of how many (and quantity) of that cpt code are stored for that one day
"RTN","PXAPI",67,0)
 ;
"RTN","PXAPI",68,0)
 ;
"RTN","PXAPI",69,0)
 N PXAVST,PXAVCPT,PXREVDAT,PXENDDAT,PXACOUNT
"RTN","PXAPI",70,0)
 S PXACPT=$G(PXACPT)
"RTN","PXAPI",71,0)
 S PXAPAT=+$G(PXAPAT)
"RTN","PXAPI",72,0)
 S PXADATE=+$G(PXADATE)
"RTN","PXAPI",73,0)
 S PXAHLOC=+$G(PXAHLOC)
"RTN","PXAPI",74,0)
 S (PXACOUNT,PXAVST)=0
"RTN","PXAPI",75,0)
 S PXREVDAT=9999999-$P(PXADATE,".")-.00000001
"RTN","PXAPI",76,0)
 S PXENDDAT=PXREVDAT+.9
"RTN","PXAPI",77,0)
 F  S PXREVDAT=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT)) Q:'PXREVDAT!(PXREVDAT>PXENDDAT)  D
"RTN","PXAPI",78,0)
 . F  S PXAVST=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT,PXAVST)) Q:'PXAVST  D
"RTN","PXAPI",79,0)
 .. Q:"E"=$P(^AUPNVSIT(PXAVST,0),"^",7)
"RTN","PXAPI",80,0)
 .. Q:"1"=$P(^AUPNVSIT(PXAVST,150),"^",2)
"RTN","PXAPI",81,0)
 .. I PXAHLOC>0,PXAHLOC'=$P(^AUPNVSIT(PXAVST,0),"^",22) Q
"RTN","PXAPI",82,0)
 .. S PXAVCPT=0
"RTN","PXAPI",83,0)
 .. F  S PXAVCPT=$O(^AUPNVCPT("AD",PXAVST,PXAVCPT)) Q:'PXAVCPT  D
"RTN","PXAPI",84,0)
 ... I PXACPT=$P(^AUPNVCPT(PXAVCPT,0),"^",1) S PXACOUNT=PXACOUNT+$P(^(0),"^",16)
"RTN","PXAPI",85,0)
 Q PXACOUNT
"RTN","PXAPI",86,0)
 ;
"RTN","PXAPI",87,0)
INTV(WHAT,PACKAGE,SOURCE,VISIT,HL,DFN,APPT,LIMITDT,ALLHLOC) ;This api will prompt the user for Visit and related V-file data used to document an encounter.
"RTN","PXAPI",88,0)
 ;See INTV^PXBAPI for parameters and return values.
"RTN","PXAPI",89,0)
 ;
"RTN","PXAPI",90,0)
 I '($D(VISIT)#2) S VISIT=""
"RTN","PXAPI",91,0)
 I '($D(DFN)#2) S DFN=""
"RTN","PXAPI",92,0)
 I '($D(HL)#2) S HL=""
"RTN","PXAPI",93,0)
 ;
"RTN","PXAPI",94,0)
 Q $$INTV^PXBAPI(WHAT,PACKAGE,SOURCE,.VISIT,.HL,.DFN,$G(APPT),$G(LIMITDT),$G(ALLHLOC))
"RTN","PXAPI",95,0)
 ;
"RTN","PXAPI",96,0)
DELVFILE(WHICH,VISIT,PACKAGE,SOURCE,ASK,ECHO,USER) ;Deletes the requested data related to the visit.
"RTN","PXAPI",97,0)
 ;See DELVFILE^PXAPIDEL for parameters and return values.
"RTN","PXAPI",98,0)
 ;
"RTN","PXAPI",99,0)
 Q $$DELVFILE^PXAPIDEL(WHICH,VISIT,$G(PACKAGE),$G(SOURCE),$G(ASK),$G(ECHO),$G(USER))
"RTN","PXAPI",100,0)
 ;
"RTN","PXAPI",101,0)
DATA2PCE(DATA,PACKAGE,SOURCE,VISIT,USER,DISPLAY,ERROR,SCREEN,ARRAY,ACCOUNT) ;API to pass data for add/edit/delete to PCE
"RTN","PXAPI",102,0)
 ;See DATA2PCE^PXAI for parameters and return values.
"RTN","PXAPI",103,0)
 ;
"RTN","PXAPI",104,0)
 I '($D(DATA)#2) Q -3
"RTN","PXAPI",105,0)
 I '($D(PACKAGE)#2) Q -3
"RTN","PXAPI",106,0)
 I '($D(SOURCE)#2) Q -3
"RTN","PXAPI",107,0)
 I '($D(VISIT)#2) S VISIT=""
"RTN","PXAPI",108,0)
 Q $$DATA2PCE^PXAI(DATA,PACKAGE,SOURCE,.VISIT,$G(USER),$G(DISPLAY),.ERROR,$G(SCREEN),.ARRAY,.ACCOUNT) ;PX*1.0*164 CHANGED $G(ERROR) TO .ERROR
"RTN","PXAPI",109,0)
 ;
"RTN","PXAPI",110,0)
SOURCE(SOURCE) ;Get IEN of data source in the PCE Data Source file
"RTN","PXAPI",111,0)
 Q $$SOURCE^PXAPIUTL($G(SOURCE))
"RTN","PXAPI",112,0)
 ;
"RTN","PXAPI",113,0)
VISITLST(DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--GATHER VISITS
"RTN","PXAPI",114,0)
 ;See VISITLST^PXBGVST for parameters and return values.
"RTN","PXAPI",115,0)
 ;
"RTN","PXAPI",116,0)
 I '($D(DFN)#2) Q "-2^NO PATIENT SELECTED"
"RTN","PXAPI",117,0)
 Q $$VISITLST^PXBGVST(DFN,$G(BEGINDT),$G(ENDDT),$G(HLOC),$G(SCREEN),$G(APPOINT),$G(PROMPT),$G(COSTATUS))
"RTN","PXAPI",118,0)
 ;
"RTN","PXAPI",119,0)
ENCEDIT(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
"RTN","PXAPI",120,0)
 ;See ENCEDIT^PXAPIEED for parameters and return values.
"RTN","PXAPI",121,0)
 ;
"RTN","PXAPI",122,0)
 Q $$ENCEDIT^PXAPIEED($G(WHAT),$G(PACKAGE),$G(SOURCE),$G(DFN),$G(BEGINDT),$G(ENDDT),$G(HLOC),$G(SCREEN),$G(APPOINT),$G(PROMPT),$G(COSTATUS))
"RTN","PXAPI",123,0)
 ;
"RTN","PXAPI",124,0)
LOPENCED(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
"RTN","PXAPI",125,0)
 ;See LOPENCED^PXAPIEED for parameters and return values.
"RTN","PXAPI",126,0)
 ;
"RTN","PXAPI",127,0)
 Q $$LOPENCED^PXAPIEED($G(WHAT),$G(PACKAGE),$G(SOURCE),$G(DFN),$G(BEGINDT),$G(ENDDT),$G(HLOC),$G(SCREEN),$G(APPOINT),$G(PROMPT),$G(COSTATUS))
"RTN","PXAPI",128,0)
 ;
"RTN","PXAPI",129,0)
GETENC(DFN,ENCDT,HLOC) ;--Get all of the encounter data
"RTN","PXAPI",130,0)
 ;See GETENC^PXKENC for parameters and return values.
"RTN","PXAPI",131,0)
 ;
"RTN","PXAPI",132,0)
 Q $$GETENC^PXKENC($G(DFN),$G(ENCDT),$G(HLOC))
"RTN","PXAPI",133,0)
 ;
"RTN","PXAPI",134,0)
ENCEVENT(VISIT,DONTKILL) ;--Get all of the encounter data
"RTN","PXAPI",135,0)
 ;See ENCEVENT^PXKENC for parameters and return values.
"RTN","PXAPI",136,0)
 ;
"RTN","PXAPI",137,0)
 D ENCEVENT^PXKENC($G(VISIT),$G(DONTKILL))
"RTN","PXAPI",138,0)
 Q
"RTN","PXAPI",139,0)
 ;
"RTN","PXAPI",140,0)
VST2APPT(VISIT) ;Is this visit related to an appointment
"RTN","PXAPI",141,0)
 ;See VST2APPT^PXUTL1 for parameters and return values.
"RTN","PXAPI",142,0)
 ;
"RTN","PXAPI",143,0)
 Q $$VST2APPT^PXUTL1($G(VISIT))
"RTN","PXAPI",144,0)
 ;
"RTN","PXAPI",145,0)
APPT2VST(DFN,ENCDT,HLOC) ;Get the visit for an Appointment
"RTN","PXAPI",146,0)
 ;See APPT2VST^PXUTL1 for parameters and return values.
"RTN","PXAPI",147,0)
 ;
"RTN","PXAPI",148,0)
 Q $$APPT2VST^PXUTL1($G(DFN),$G(ENCDT),$G(HLOC))
"RTN","PXAPI",149,0)
 ;
"RTN","PXAPI",150,0)
SWITCHD() ;This returns the date that PCE starts collecting the data
"RTN","PXAPI",151,0)
 ; instead Scheduling (switch over date).
"RTN","PXAPI",152,0)
 Q $P($G(^PX(815,1,0)),"^",2)
"RTN","PXAPI",153,0)
 ;
"RTN","PXAPI",154,0)
SWITCHCK(DATE) ;Returns 1 if after the switch over date 0 otherwise.
"RTN","PXAPI",155,0)
 N SWITCH
"RTN","PXAPI",156,0)
 S SWITCH=$P($G(^PX(815,1,0)),"^",2)
"RTN","PXAPI",157,0)
 Q:SWITCH<2960000 0
"RTN","PXAPI",158,0)
 Q SWITCH'>DATE
"RTN","PXAPI",159,0)
 ;
"RTN","PXAPI",160,0)
DISPVSIT ;Called by Scheduling to create a visit for a disposition
"RTN","PXAPI",161,0)
 ;Add to fix scheduling calling visit tracking wrong without the
"RTN","PXAPI",162,0)
 ;  dispositioning clinic.  Hospital Location is required by Visit
"RTN","PXAPI",163,0)
 ;  Tracking to work correctly.
"RTN","PXAPI",164,0)
 I $G(VSIT("LOC"))>0,'$D(^PX(815,1,"DHL","B",VSIT("LOC"))) S VSIT("LOC")=""
"RTN","PXAPI",165,0)
 I $G(VSIT("LOC"))'>0,'$D(ZTQUEUED) D
"RTN","PXAPI",166,0)
 . I $P(^PX(815,1,"DHL",0),"^",4)=1 S VSIT("LOC")=$O(^PX(815,1,"DHL","B",0))
"RTN","PXAPI",167,0)
 . E  D
"RTN","PXAPI",168,0)
 .. ;ask for Hospital location from those that can disposition
"RTN","PXAPI",169,0)
 .. N DIC,DA,X,Y
"RTN","PXAPI",170,0)
DISPASK .. S DA(1)=1
"RTN","PXAPI",171,0)
 .. S DIC="^PX(815,1,""DHL"","
"RTN","PXAPI",172,0)
 .. S DIC("P")=$P(^DD(815,401,0),"^",2)
"RTN","PXAPI",173,0)
 .. S DIC(0)="AEOQ"
"RTN","PXAPI",174,0)
 .. D ^DIC
"RTN","PXAPI",175,0)
 .. I Y>0 S VSIT("LOC")=$P(Y,"^",2)
"RTN","PXAPI",176,0)
 .. ;E  I '$D(DTOUT),'$D(DUOUT) W !!,$C(7),"Disposition Hospital Location is required." G DISPASK
"RTN","PXAPI",177,0)
 .. E  W !!,$C(7),"Disposition Hospital Location is required." G DISPASK
"RTN","PXAPI",178,0)
 I $G(VSIT("LOC"))'>0 S VSIT("IEN")=-1
"RTN","PXAPI",179,0)
 E  D ^VSIT
"RTN","PXAPI",180,0)
 Q
"RTN","PXAPI",181,0)
 ;
"RTN","PXAPI",182,0)
ACTIVPRV(PROVIDER,VISITDT) ;See if this is a good provider on the date of
"RTN","PXAPI",183,0)
 ;VISITDT and returns 1 if it is 0 if it is not.
"RTN","PXAPI",184,0)
 ;Can be used like S DIC("S")="I $$ACTIVPRV^PXAPIUTL(PRV,DATE)"
"RTN","PXAPI",185,0)
 Q:+$$PRVCLASS^PXAPIUTL($G(PROVIDER),$G(VISITDT))>0 1
"RTN","PXAPI",186,0)
 Q 0
"RTN","PXAPI",187,0)
 ;
"RTN","PXAPI",188,0)
PRVCLASS(PROVIDER,VISITDT) ;See if this is a good provider
"RTN","PXAPI",189,0)
 ;See PRVCLASS^PXAPIUTL for parameters and return values.
"RTN","PXAPI",190,0)
 Q $$PRVCLASS^PXAPIUTL($G(PROVIDER),$G(VISITDT))
"RTN","PXAPI",191,0)
 ;
"RTN","PXAPI",192,0)
VIS(PXRESULT,PXVIS,PXDATE) ;Return Vaccine Information Statement entry
"RTN","PXAPI",193,0)
 ;See VIS^PXAPIIM for parameters and return values.
"RTN","PXAPI",194,0)
 ;
"RTN","PXAPI",195,0)
 I '$G(PXVIS) Q
"RTN","PXAPI",196,0)
 S PXDATE=$G(PXDATE,$$NOW^XLFDT())
"RTN","PXAPI",197,0)
 D VIS^PXAPIIM(.PXRESULT,PXVIS,PXDATE)
"RTN","PXAPI",198,0)
 Q
"RTN","PXAPIIM")
0^12^B2741056^n/a
"RTN","PXAPIIM",1,0)
PXAPIIM ;BP/LMT - PCE Immunization APIs ;06/30/15  10:23
"RTN","PXAPIIM",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXAPIIM",3,0)
 ;
"RTN","PXAPIIM",4,0)
 Q
"RTN","PXAPIIM",5,0)
 ;
"RTN","PXAPIIM",6,0)
VIS(PXRESULT,PXVIS,PXDATE) ;Called from VIS^PXAPI
"RTN","PXAPIIM",7,0)
 ;
"RTN","PXAPIIM",8,0)
 ;Input:
"RTN","PXAPIIM",9,0)
 ;  PXRESULT  (required) Return value (passed by reference)
"RTN","PXAPIIM",10,0)
 ;     PXVIS  (required) Pointer to #920
"RTN","PXAPIIM",11,0)
 ;    PXDATE  (optional; defaults to NOW) The date in FileMan format.
"RTN","PXAPIIM",12,0)
 ;                       Used to check the status of the VIS on that date.
"RTN","PXAPIIM",13,0)
 ;Returns:
"RTN","PXAPIIM",14,0)
 ;  PXRESULT("NAME") = VIS Name
"RTN","PXAPIIM",15,0)
 ;  PXRESULT("EDITION DATE") = FileManager Internal Format for date/time
"RTN","PXAPIIM",16,0)
 ;  PXRESULT("EDITION STATUS") = code^value (C^CURRENT or H^HISTORIC)
"RTN","PXAPIIM",17,0)
 ;  PXRESULT("LANGUAGE") = IEN ^ Language (e.g., 1^ENGLISH)
"RTN","PXAPIIM",18,0)
 ;  PXRESULT("2D BAR CODE") = Barcode from the CDC VIS barcode lookup table
"RTN","PXAPIIM",19,0)
 ;  PXRESULT("VIS URL") = Internet URL for this VIS
"RTN","PXAPIIM",20,0)
 ;  PXRESULT("STATUS") = Status based on PXDATE (1^ACTIVE or 0^INACTIVE)
"RTN","PXAPIIM",21,0)
 ;
"RTN","PXAPIIM",22,0)
 N PXDATA,PXFILE,PXIENS,PXLANG,PXSTATUS
"RTN","PXAPIIM",23,0)
 ;
"RTN","PXAPIIM",24,0)
 S PXFILE=920
"RTN","PXAPIIM",25,0)
 S PXIENS=PXVIS_","
"RTN","PXAPIIM",26,0)
 D GETS^DIQ(PXFILE,PXIENS,"*","EI","PXDATA")
"RTN","PXAPIIM",27,0)
 ;
"RTN","PXAPIIM",28,0)
 S PXRESULT("NAME")=$G(PXDATA(PXFILE,PXIENS,.01,"E"))
"RTN","PXAPIIM",29,0)
 S PXRESULT("EDITION DATE")=$G(PXDATA(PXFILE,PXIENS,.02,"I"))
"RTN","PXAPIIM",30,0)
 S PXRESULT("EDITION STATUS")=$G(PXDATA(PXFILE,PXIENS,.03,"I"))_U_$G(PXDATA(PXFILE,PXIENS,.03,"E"))
"RTN","PXAPIIM",31,0)
 S PXRESULT("2D BAR CODE")=$G(PXDATA(PXFILE,PXIENS,100,"E"))
"RTN","PXAPIIM",32,0)
 S PXRESULT("VIS URL")=$G(PXDATA(PXFILE,PXIENS,101,"E"))
"RTN","PXAPIIM",33,0)
 ;
"RTN","PXAPIIM",34,0)
 S PXLANG=$G(PXDATA(PXFILE,PXIENS,.04,"I"))
"RTN","PXAPIIM",35,0)
 I PXLANG D
"RTN","PXAPIIM",36,0)
 . S PXLANG=PXLANG_U_$$GET1^DIQ(PXFILE,PXIENS,".04:1")
"RTN","PXAPIIM",37,0)
 S PXRESULT("LANGUAGE")=PXLANG
"RTN","PXAPIIM",38,0)
 ;
"RTN","PXAPIIM",39,0)
 S PXSTATUS=$$GETSTAT^XTID(PXFILE,.01,PXIENS,PXDATE)
"RTN","PXAPIIM",40,0)
 S PXRESULT("STATUS")=$P(PXSTATUS,U,1)_U_$P(PXSTATUS,U,3)
"RTN","PXAPIIM",41,0)
 ;
"RTN","PXAPIIM",42,0)
 Q
"RTN","PXCASK")
0^25^B16288608^B15678860
"RTN","PXCASK",1,0)
PXCASK ;ISL/dee - Validates & Translates data from the PCE Device Interface into PCE's PXK format for Skin Test ;07/30/15  09:15
"RTN","PXCASK",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**27,124,199,210**;Aug 12, 1996;Build 11
"RTN","PXCASK",3,0)
 Q
"RTN","PXCASK",4,0)
 ; Variables
"RTN","PXCASK",5,0)
 ;   PXCASK  Copy of a SKIN TEST node of the PXCA array
"RTN","PXCASK",6,0)
 ;   PXCAPRV   Pointer to the provider (200)
"RTN","PXCASK",7,0)
 ;   PXCANUMB  Count of the number if SKs
"RTN","PXCASK",8,0)
 ;   PXCAINDX  Count of the number of SKIN TEST for one provider
"RTN","PXCASK",9,0)
 ;   PXCAFTER  Temp used to build ^TMP(PXCAGLB,$J,"SK",PXCANUMB,0,"AFTER")
"RTN","PXCASK",10,0)
 ;   PXCAPNAR  Pointer to the provider narrative (9999999.27)
"RTN","PXCASK",11,0)
 ;
"RTN","PXCASK",12,0)
SK(PXCASK,PXCANUMB,PXCAPRV,PXCAERRS) ;
"RTN","PXCASK",13,0)
 N PXCAFTER
"RTN","PXCASK",14,0)
 S PXCAFTER=$P(PXCASK,"^",1)_"^"_PXCAPAT_"^"_PXCAVSIT_"^"
"RTN","PXCASK",15,0)
 S PXCAFTER=PXCAFTER_$P(PXCASK,"^",3)_"^"
"RTN","PXCASK",16,0)
 S PXCAFTER=PXCAFTER_$P(PXCASK,"^",2)_"^"
"RTN","PXCASK",17,0)
 ;PX*1*124
"RTN","PXCASK",18,0)
 S PXCAFTER=PXCAFTER_$P(PXCASK,"^",4)
"RTN","PXCASK",19,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,"IEN")=""
"RTN","PXCASK",20,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,0,"BEFORE")=""
"RTN","PXCASK",21,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,0,"AFTER")=PXCAFTER
"RTN","PXCASK",22,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,12,"BEFORE")=""
"RTN","PXCASK",23,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,12,"AFTER")=$P(PXCASK,"^",5)_"^^^"_$S(PXCAPRV>0:PXCAPRV,1:"")
"RTN","PXCASK",24,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,80,"BEFORE")=""
"RTN","PXCASK",25,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,80,"AFTER")=$P(PXCASK,"^",6)_"^"_$P(PXCASK,"^",7)_"^"_$P(PXCASK,"^",8)_"^"_$P(PXCASK,"^",9)_"^"_$P(PXCASK,"^",10)_"^"_$P(PXCASK,"^",11)_"^"_$P(PXCASK,"^",12)_"^"_$P(PXCASK,"^",13)
"RTN","PXCASK",26,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,812,"BEFORE")=""
"RTN","PXCASK",27,0)
 S ^TMP(PXCAGLB,$J,"SK",PXCANUMB,812,"AFTER")="^"_PXCAPKG_"^"_PXCASOR
"RTN","PXCASK",28,0)
 Q
"RTN","PXCASK",29,0)
 ;
"RTN","PXCASK",30,0)
SKINTEST(PXCA,PXCABULD,PXCAERRS) ;Validation routine for SK
"RTN","PXCASK",31,0)
 Q:'$D(PXCA("SKIN TEST"))
"RTN","PXCASK",32,0)
 N ICDDATA,ICDPCE,PXCAINDX,PXCAITEM,PXCANUMB,PXCAPRV,PXCASK,PXDXDATE
"RTN","PXCASK",33,0)
 S PXDXDATE=$S($D(PXCAVSIT)=1:$$CSDATE^PXDXUTL(PXCAVSIT),$D(PXCADT)=1:PXCADT,1:DT)
"RTN","PXCASK",34,0)
 S PXCAPRV="",PXCANUMB=0
"RTN","PXCASK",35,0)
 F  S PXCAPRV=$O(PXCA("SKIN TEST",PXCAPRV)) Q:PXCAPRV']""  D
"RTN","PXCASK",36,0)
 . I PXCAPRV>0 D
"RTN","PXCASK",37,0)
 .. I '$$ACTIVPRV^PXAPI(PXCAPRV,PXCADT) S PXCA("ERROR","SKIN TEST",PXCAPRV,0,0)="Provider is not active or valid^"_PXCAPRV
"RTN","PXCASK",38,0)
 .. E  I PXCABULD!PXCAERRS D ANOTHPRV^PXCAPRV(PXCAPRV)
"RTN","PXCASK",39,0)
 . S PXCAINDX=""
"RTN","PXCASK",40,0)
 . F  S PXCAINDX=$O(PXCA("SKIN TEST",PXCAPRV,PXCAINDX)) Q:PXCAINDX']""  D
"RTN","PXCASK",41,0)
 .. S PXCASK=$G(PXCA("SKIN TEST",PXCAPRV,PXCAINDX))
"RTN","PXCASK",42,0)
 .. S PXCANUMB=PXCANUMB+1
"RTN","PXCASK",43,0)
 .. I PXCASK="" S PXCA("ERROR","SKIN TEST",PXCAPRV,PXCAINDX,0)="SKIN TEST data missing" Q
"RTN","PXCASK",44,0)
 .. S PXCAITEM=+$P(PXCASK,"^",1)
"RTN","PXCASK",45,0)
 .. I $G(^AUTTSK(PXCAITEM,0))="" S PXCA("ERROR","SKIN TEST",PXCAPRV,PXCAINDX,1)="SKIN TEST type not in file 9999999.28^"_PXCAITEM
"RTN","PXCASK",46,0)
 .. S PXCAITEM=$P(PXCASK,"^",2)
"RTN","PXCASK",47,0)
 .. I '((PXCAITEM=(PXCAITEM\1)&(PXCAITEM>-1)&(PXCAITEM<41))!(PXCAITEM="")) S PXCA("ERROR","SKIN TEST",PXCAPRV,PXCAINDX,2)="SKIN TEST reaction must be an integer form 0 to 40^"_PXCAITEM
"RTN","PXCASK",48,0)
 .. S PXCAITEM=$P(PXCASK,"^",3)
"RTN","PXCASK",49,0)
 .. I '(PXCAITEM=""!(PXCAITEM="P")!(PXCAITEM="N")!(PXCAITEM="D")!(PXCAITEM="O")) S PXCA("ERROR","SKIN TEST",PXCAPRV,PXCAINDX,3)="SKIN TEST results must be P|N|D|O^"_PXCAITEM
"RTN","PXCASK",50,0)
 .. F ICDPCE=6:1:13 D
"RTN","PXCASK",51,0)
 ... S PXCAITEM=$P(PXCASK,"^",ICDPCE) I PXCAITEM]"" D
"RTN","PXCASK",52,0)
 .... S ICDDATA=$$ICDDATA^ICDXCODE("DIAG",PXCAITEM,PXDXDATE,"I")
"RTN","PXCASK",53,0)
 .... I $P(ICDDATA,"^",1)'>0 D
"RTN","PXCASK",54,0)
 ..... S PXCA("ERROR","SKIN TEST",PXCAPRV,PXCAINDX,ICDPCE)="SKIN TEST Diagnosis # "_(ICDPCE-5)_" not in file 80^"_PXCAITEM
"RTN","PXCASK",55,0)
 .... E  I $P(ICDDATA,"^",10)'=1 D
"RTN","PXCASK",56,0)
 ..... S PXCA("ERROR","SKIN TEST",PXCAPRV,PXCAINDX,ICDPCE)="SKIN TEST Diagnosis # "_(ICDPCE-5)_" not an ACTIVE ICD Code^"_PXCAITEM
"RTN","PXCASK",57,0)
 .. I PXCABULD&'$D(PXCA("ERROR","SKIN TEST",PXCAPRV,PXCAINDX))!PXCAERRS D SK(PXCASK,.PXCANUMB,PXCAPRV,PXCAERRS)
"RTN","PXCASK",58,0)
 Q
"RTN","PXCASK",59,0)
 ;
"RTN","PXCAVIMM")
0^26^B21317143^B20851145
"RTN","PXCAVIMM",1,0)
PXCAVIMM ;ISL/dee - Validates & Translates data from the PCE Device Interface into PCE's PXK format for Immunizations ;07/30/15  09:21
"RTN","PXCAVIMM",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**27,124,199,210**;Aug 12, 1996;Build 11
"RTN","PXCAVIMM",3,0)
 Q
"RTN","PXCAVIMM",4,0)
 ; Variables
"RTN","PXCAVIMM",5,0)
 ;   PXCAIMM  Copy of a IMMUNIZATION node of the PXCA array
"RTN","PXCAVIMM",6,0)
 ;   PXCAPRV   Pointer to the provider (200)
"RTN","PXCAVIMM",7,0)
 ;   PXCANUMB  Count of the number if IMMs
"RTN","PXCAVIMM",8,0)
 ;   PXCAINDX  Count of the number of IMMUNIZATION for one provider
"RTN","PXCAVIMM",9,0)
 ;   PXCAFTER  Temp used to build ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,0,"AFTER")
"RTN","PXCAVIMM",10,0)
 ;   PXCAPNAR  Pointer to the provider narrative (9999999.27)
"RTN","PXCAVIMM",11,0)
 ;
"RTN","PXCAVIMM",12,0)
IMM(PXCAIMM,PXCANUMB,PXCAPRV,PXCAERRS) ;
"RTN","PXCAVIMM",13,0)
 N PXCAFTER,PXDIAGPC,PXSEQ
"RTN","PXCAVIMM",14,0)
 S PXCAFTER=$P(PXCAIMM,"^",1)_"^"_PXCAPAT_"^"_PXCAVSIT_"^"
"RTN","PXCAVIMM",15,0)
 S PXCAFTER=PXCAFTER_$P(PXCAIMM,"^",2,4)
"RTN","PXCAVIMM",16,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,"IEN")=""
"RTN","PXCAVIMM",17,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,0,"BEFORE")=""
"RTN","PXCAVIMM",18,0)
 ;PX*1*124
"RTN","PXCAVIMM",19,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,0,"AFTER")=PXCAFTER
"RTN","PXCAVIMM",20,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,12,"BEFORE")=""
"RTN","PXCAVIMM",21,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,12,"AFTER")=$P(PXCAIMM,"^",6)_"^^^"_$S(PXCAPRV>0:PXCAPRV,1:"")
"RTN","PXCAVIMM",22,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,13,"BEFORE")=""
"RTN","PXCAVIMM",23,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,13,"AFTER")="^^^"_$P(PXCAIMM,"^",8)
"RTN","PXCAVIMM",24,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,811,"BEFORE")=""
"RTN","PXCAVIMM",25,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,811,"AFTER")=$P(PXCAIMM,"^",7)
"RTN","PXCAVIMM",26,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,812,"BEFORE")=""
"RTN","PXCAVIMM",27,0)
 S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,812,"AFTER")="^"_PXCAPKG_"^"_PXCASOR
"RTN","PXCAVIMM",28,0)
 ;
"RTN","PXCAVIMM",29,0)
 S PXSEQ=0
"RTN","PXCAVIMM",30,0)
 F PXDIAGPC=9:1:15 D
"RTN","PXCAVIMM",31,0)
 . I $P(PXCAIMM,"^",PXDIAGPC)'="" D
"RTN","PXCAVIMM",32,0)
 . . S PXSEQ=PXSEQ+1
"RTN","PXCAVIMM",33,0)
 . . S ^TMP(PXCAGLB,$J,"IMM",PXCANUMB,3,PXSEQ,"AFTER")=$P(PXCAIMM,"^",PXDIAGPC)
"RTN","PXCAVIMM",34,0)
 Q
"RTN","PXCAVIMM",35,0)
 ;
"RTN","PXCAVIMM",36,0)
IMMUN(PXCA,PXCABULD,PXCAERRS) ;Validation routine for IMM
"RTN","PXCAVIMM",37,0)
 Q:'$D(PXCA("IMMUNIZATION"))
"RTN","PXCAVIMM",38,0)
 N PXCAIMM,PXCAINDX,PXCAITEM,PXCAITM2,PXCANUMB,PXCAPRV,PXDXDATE
"RTN","PXCAVIMM",39,0)
 S PXDXDATE=$S($D(PXCAVSIT)=1:$$CSDATE^PXDXUTL(PXCAVSIT),$D(PXCADT)=1:PXCADT,1:DT)
"RTN","PXCAVIMM",40,0)
 S PXCAPRV="",PXCANUMB=0
"RTN","PXCAVIMM",41,0)
 F  S PXCAPRV=$O(PXCA("IMMUNIZATION",PXCAPRV)) Q:PXCAPRV']""  D
"RTN","PXCAVIMM",42,0)
 . I PXCAPRV>0 D
"RTN","PXCAVIMM",43,0)
 .. I '$$ACTIVPRV^PXAPI(PXCAPRV,PXCADT) S PXCA("ERROR","IMMUNIZATION",PXCAPRV,0,0)="Provider is not active or valid^"_PXCAPRV
"RTN","PXCAVIMM",44,0)
 .. E  I PXCABULD!PXCAERRS D ANOTHPRV^PXCAPRV(PXCAPRV)
"RTN","PXCAVIMM",45,0)
 . S PXCAINDX=0
"RTN","PXCAVIMM",46,0)
 . F  S PXCAINDX=$O(PXCA("IMMUNIZATION",PXCAPRV,PXCAINDX)) Q:PXCAINDX']""  D
"RTN","PXCAVIMM",47,0)
 .. S PXCAIMM=$G(PXCA("IMMUNIZATION",PXCAPRV,PXCAINDX))
"RTN","PXCAVIMM",48,0)
 .. S PXCANUMB=PXCANUMB+1
"RTN","PXCAVIMM",49,0)
 .. I PXCAIMM="" S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,0)="IMMUNIZATION data missing" Q
"RTN","PXCAVIMM",50,0)
 .. S PXCAITEM=+$P(PXCAIMM,U,1)
"RTN","PXCAVIMM",51,0)
 .. I $G(^AUTTIMM(PXCAITEM,0))="" S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,1)="IMMUNIZATION type not in file 9999999.14^"_PXCAITEM
"RTN","PXCAVIMM",52,0)
 .. S PXCAITEM=$P(PXCAIMM,U,2)
"RTN","PXCAVIMM",53,0)
 .. I '(PXCAITEM=""!(PXCAITEM="P")!(PXCAITEM="C")!(PXCAITEM="B")!((PXCAITEM=(PXCAITEM\1))&(PXCAITEM>0)&(PXCAITEM<9))) S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,2)="IMMUNIZATION series must be P|C|B|1|2|3|4|5|6|7|8^"_PXCAITEM
"RTN","PXCAVIMM",54,0)
 .. S PXCAITEM=$P(PXCAIMM,U,4)
"RTN","PXCAVIMM",55,0)
 .. I '((PXCAITEM=(PXCAITEM\1)&(PXCAITEM>0)&(PXCAITEM<12))!(PXCAITEM="")) S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,4)="IMMUNIZATION reaction must be an integer form 1 to 11^"_PXCAITEM
"RTN","PXCAVIMM",56,0)
 .. S PXCAITEM=$P(PXCAIMM,U,5)
"RTN","PXCAVIMM",57,0)
 .. I '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM="")) S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,5)="IMMUNIZATION contraindicated flag bad^"_PXCAITEM
"RTN","PXCAVIMM",58,0)
 .. S PXCAITEM=$P(PXCAIMM,U,6)
"RTN","PXCAVIMM",59,0)
 .. S PXCAITEM=$P(PXCAIMM,U,7)
"RTN","PXCAVIMM",60,0)
 .. I $L(PXCAITEM)>80 S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,6)="IMMUNIZATION remarks must be 1-80 Characters^"_PXCAITEM
"RTN","PXCAVIMM",61,0)
 .. F ICDPCE=8:1:15 D
"RTN","PXCAVIMM",62,0)
 ... S PXCAITEM=$P(PXCAIMM,U,ICDPCE) I PXCAITEM]"" D
"RTN","PXCAVIMM",63,0)
 .... S ICDDATA=$$ICDDATA^ICDXCODE("DIAG",PXCAITEM,PXDXDATE,"I")
"RTN","PXCAVIMM",64,0)
 .... I $P(ICDDATA,U,1)'>0 D
"RTN","PXCAVIMM",65,0)
 ..... S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,ICDPCE)="IMMUNIZATION Diagnosis # "_(ICDPCE-7)_" not in file 80^"_PXCAITEM
"RTN","PXCAVIMM",66,0)
 .... E  I $P(ICDDATA,U,10)'=1 D
"RTN","PXCAVIMM",67,0)
 ..... S PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX,ICDPCE)="IMMUNIZATION Diagnosis # "_(ICDPCE-7)_" not an ACTIVE ICD Code^"_PXCAITEM
"RTN","PXCAVIMM",68,0)
 .. I PXCABULD&'$D(PXCA("ERROR","IMMUNIZATION",PXCAPRV,PXCAINDX))!PXCAERRS D IMM(PXCAIMM,.PXCANUMB,PXCAPRV,PXCAERRS)
"RTN","PXCAVIMM",69,0)
 Q
"RTN","PXCAVIMM",70,0)
 ;
"RTN","PXCESK")
0^17^B21683167^B17217954
"RTN","PXCESK",1,0)
PXCESK ;ISL/dee - Used to edit and display V SKIN TEST ;07/29/2015
"RTN","PXCESK",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**27,124,162,210**;Aug 12, 1996;Build 11
"RTN","PXCESK",3,0)
 ;; ;
"RTN","PXCESK",4,0)
 Q
"RTN","PXCESK",5,0)
 ;
"RTN","PXCESK",6,0)
 ;Line with the line label "FORMAT"
"RTN","PXCESK",7,0)
 ;;Long name~File Number~Node Subscripts~Allow Duplicate entries (1=yes, 0=no)~File global name
"RTN","PXCESK",8,0)
 ;     1         2             3                   4                                   5
"RTN","PXCESK",9,0)
 ;
"RTN","PXCESK",10,0)
 ;Followning lines:
"RTN","PXCESK",11,0)
 ;;Node~Piece~,Field Number~Edit Label~Display Label~Display Routine~Edit Routine~Help Text for DIR("?")~Set of PXCEKEYS that can Edit~D if Detail Display Only~
"RTN","PXCESK",12,0)
 ;  1  ~  2  ~      3      ~     4    ~        5    ~        6      ~     7      ~       8              ~          9                  ~       10
"RTN","PXCESK",13,0)
 ;The Display & Edit routines are for special caces.
"RTN","PXCESK",14,0)
 ;  (The .01 field cannot have a special edit.)
"RTN","PXCESK",15,0)
 ;
"RTN","PXCESK",16,0)
 ;***Reading (.05) must be the line before Results (.04)***
"RTN","PXCESK",17,0)
 ;
"RTN","PXCESK",18,0)
FORMAT ;;Skin Test~9000010.12~0,12,13,80,811,812~1~^AUPNVSK
"RTN","PXCESK",19,0)
 ;;0~1~.01~Skin Test:  ~Skin Test:  ~~~~~B
"RTN","PXCESK",20,0)
 ;;12~1~1201~Placement Date and Time:  ~Date/Time of Placement:  ~~~~~D
"RTN","PXCESK",21,0)
 ;;12~2~1202~Ordering Provider:  ~Ordering Provider:  ~~EPROV12^PXCEPRV~~~D
"RTN","PXCESK",22,0)
 ;;12~4~1204~Administered By: ~Administered By:  ~~EPROV12^PXCEPRV~~~D
"RTN","PXCESK",23,0)
 ;;12~12~1212~Anatomic Location: ~Anatomic Location of Placement:  ~~~~~D
"RTN","PXCESK",24,0)
 ;;811~1~81101~Placement Comments:  ~Placement Comments:  ~~~~~D
"RTN","PXCESK",25,0)
 ;;0~6~.06~Reading Date and Time:  ~Reading Date/Time:  ~~~~~D
"RTN","PXCESK",26,0)
 ;;12~14~1214~Hours Read Post-Placement:  ~Hours Read Post-Placement:  ~~~~~D
"RTN","PXCESK",27,0)
 ;;0~7~.07~Reader:  ~Reader:  ~~EPROV12^PXCEPRV~~~D
"RTN","PXCESK",28,0)
 ;;0~5~.05~Reading in millimeters (mm):  ~Reading in millimeters (mm):  ~~EREADING^PXCESK~~~D
"RTN","PXCESK",29,0)
 ;;0~4~.04~Results~Results:  ~~ERESULTS^PXCESK~~~D
"RTN","PXCESK",30,0)
 ;;13~1~1301~Reading Comments:  ~Reading Comments:  ~~~~~D
"RTN","PXCESK",31,0)
 ;;80~1~801~Diagnosis:  ~Diagnosis:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",32,0)
 ;;80~2~802~Diagnosis 2:  ~Diagnosis 2:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",33,0)
 ;;80~3~803~Diagnosis 3:  ~Diagnosis 3:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",34,0)
 ;;80~4~804~Diagnosis 4:  ~Diagnosis 4:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",35,0)
 ;;80~5~805~Diagnosis 5:  ~Diagnosis 5:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",36,0)
 ;;80~6~806~Diagnosis 6:  ~Diagnosis 6:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",37,0)
 ;;80~7~807~Diagnosis 7:  ~Diagnosis 7:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",38,0)
 ;;80~8~808~Diagnosis 8:  ~Diagnosis 8:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCESK",39,0)
 ;;
"RTN","PXCESK",40,0)
 ;
"RTN","PXCESK",41,0)
 ;The interface for AICS to get list on form for help.
"RTN","PXCESK",42,0)
INTRFACE ;;PX SELECT SKIN TEST
"RTN","PXCESK",43,0)
 ;
"RTN","PXCESK",44,0)
 ;********************************
"RTN","PXCESK",45,0)
 ;Special cases for display.
"RTN","PXCESK",46,0)
 ;
"RTN","PXCESK",47,0)
 ;********************************
"RTN","PXCESK",48,0)
 ;Special cases for edit.
"RTN","PXCESK",49,0)
 ;
"RTN","PXCESK",50,0)
EREADING ;
"RTN","PXCESK",51,0)
 I $P(PXCEAFTR(0),"^",5)'="" D
"RTN","PXCESK",52,0)
 . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCESK",53,0)
 . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
"RTN","PXCESK",54,0)
 . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
"RTN","PXCESK",55,0)
 . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCESK",56,0)
 S DIR(0)="NAO^0:40:0"
"RTN","PXCESK",57,0)
 S DIR("A")=$P(PXCETEXT,"~",4)
"RTN","PXCESK",58,0)
 S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
"RTN","PXCESK",59,0)
 D ^DIR
"RTN","PXCESK",60,0)
 K DIR,DA
"RTN","PXCESK",61,0)
 I X="@" S Y="@"
"RTN","PXCESK",62,0)
 E  I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 Q
"RTN","PXCESK",63,0)
 S $P(PXCEAFTR(0),"^",5)=$P(Y,"^")
"RTN","PXCESK",64,0)
 Q
"RTN","PXCESK",65,0)
 ;
"RTN","PXCESK",66,0)
ERESULTS ;
"RTN","PXCESK",67,0)
 I $P(PXCEAFTR(0),"^",4)'="" D
"RTN","PXCESK",68,0)
 . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCESK",69,0)
 . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
"RTN","PXCESK",70,0)
 . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
"RTN","PXCESK",71,0)
 . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCESK",72,0)
 S DIR(0)="SOM^P:POSITIVE;N:NEGATIVE;D:DOUBTFUL;O:NO TAKE"
"RTN","PXCESK",73,0)
 S DIR("A")=$P(PXCETEXT,"~",4)
"RTN","PXCESK",74,0)
 S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
"RTN","PXCESK",75,0)
 D ^DIR
"RTN","PXCESK",76,0)
 K DIR,DA
"RTN","PXCESK",77,0)
 I X="@" S Y="@"
"RTN","PXCESK",78,0)
 E  I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 Q
"RTN","PXCESK",79,0)
 S $P(PXCEAFTR(0),"^",4)=$P(Y,"^")
"RTN","PXCESK",80,0)
 Q
"RTN","PXCESK",81,0)
 ;
"RTN","PXCESK",82,0)
 ;********************************
"RTN","PXCESK",83,0)
 ;Display text for the .01 field which is a pointer to Skin Test.
"RTN","PXCESK",84,0)
 ;(Must have is called by ASK^PXCEVFI2 and DEL^PXCEVFI2.)
"RTN","PXCESK",85,0)
DISPLY01(PXCESK) ;
"RTN","PXCESK",86,0)
 N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCESK",87,0)
 S PXCEINT=$P(PXCESK,"^",1)
"RTN","PXCESK",88,0)
 S PXCEEXT=$$EXTERNAL^DILFD(9000010.12,.01,"",PXCEINT,"PXCEDILF")
"RTN","PXCESK",89,0)
 Q $S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCESK",90,0)
 ;
"RTN","PXCESK",91,0)
 ;********************************
"RTN","PXCESK",92,0)
 ;
"RTN","PXCESK",93,0)
SAVE ;Special code for saving a Skin Test.
"RTN","PXCESK",94,0)
 N PXCERR
"RTN","PXCESK",95,0)
 S PXCERR=$P(^TMP("PXK",$J,PXCECATS,1,0,"AFTER"),"^",4,5)
"RTN","PXCESK",96,0)
 Q:PXCERR="^"
"RTN","PXCESK",97,0)
 I $P(PXCERR,"^",1)'=$P(^TMP("PXK",$J,PXCECATS,1,0,"BEFORE"),"^",4) S $P(^TMP("PXK",$J,PXCECATS,1,0,"AFTER"),"^",4)="@"
"RTN","PXCESK",98,0)
 I $P(PXCERR,"^",2)'=$P(^TMP("PXK",$J,PXCECATS,1,0,"BEFORE"),"^",5) S $P(^TMP("PXK",$J,PXCECATS,1,0,"AFTER"),"^",5)="@"
"RTN","PXCESK",99,0)
 D EN1^PXKMAIN
"RTN","PXCESK",100,0)
 S ^TMP("PXK",$J,PXCECATS,1,0,"AFTER")=PXCEAFTR(0)
"RTN","PXCESK",101,0)
 S ^TMP("PXK",$J,PXCECATS,1,12,"AFTER")=PXCEAFTR(12)
"RTN","PXCESK",102,0)
 S ^TMP("PXK",$J,PXCECATS,1,13,"AFTER")=PXCEAFTR(13)
"RTN","PXCESK",103,0)
 S ^TMP("PXK",$J,PXCECATS,1,80,"AFTER")=PXCEAFTR(80)
"RTN","PXCESK",104,0)
 S ^TMP("PXK",$J,PXCECATS,1,811,"AFTER")=PXCEAFTR(811)
"RTN","PXCESK",105,0)
 Q
"RTN","PXCEVFI1")
0^15^B23008473^B20919668
"RTN","PXCEVFI1",1,0)
PXCEVFI1 ;ISL/dee,esw - Routine to edit a visit or v-file entry ;02/09/2015
"RTN","PXCEVFI1",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**23,73,112,136,143,124,184,185,210**;Aug 12, 1996;Build 11
"RTN","PXCEVFI1",3,0)
 Q
"RTN","PXCEVFI1",4,0)
 ;
"RTN","PXCEVFI1",5,0)
EDIT ; -- edit the V-File stored in "AFTER"
"RTN","PXCEVFI1",6,0)
 N DIR,DA,X,Y,C,PXCEINP,PXCEIN01,PXCEEND,PXD
"RTN","PXCEVFI1",7,0)
 N PXCELINE,PXCETEXT,PXCEDIRB,PXCEMOD
"RTN","PXCEVFI1",8,0)
 N PXCEKEY,PXCEIKEY,PXCENKEY,PXMDCNT
"RTN","PXCEVFI1",9,0)
 W !
"RTN","PXCEVFI1",10,0)
 G:PXCECAT="VST"!(PXCECAT="APPM")!(PXCECAT="CSTP") REST
"RTN","PXCEVFI1",11,0)
 ;
"RTN","PXCEVFI1",12,0)
EDIT01 ;
"RTN","PXCEVFI1",13,0)
 I PXCECAT="CPT"!(PXCECAT="POV")!(PXCECAT="SK")!(PXCECAT="IMM") D SC^PXCEVFI2($P(^AUPNVSIT(PXCEVIEN,0),U,5))
"RTN","PXCEVFI1",14,0)
 S PXCETEXT=$P($T(FORMAT+1^@PXCECODE),";;",2)
"RTN","PXCEVFI1",15,0)
 K DIR,DA,X,Y,C,PXCEDIRB
"RTN","PXCEVFI1",16,0)
 I $P(PXCEAFTR(0),"^",1) D
"RTN","PXCEVFI1",17,0)
 . N DIEER,PXCEDILF,PXCEEXT
"RTN","PXCEVFI1",18,0)
 . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,.01,"",$P(PXCEAFTR(0),"^",1),"PXCEDILF")
"RTN","PXCEVFI1",19,0)
 . S PXCEDIRB=$S('$D(DIERR):PXCEEXT,1:$P(PXCEAFTR(0),"^",1))
"RTN","PXCEVFI1",20,0)
 E  S PXCEDIRB=""
"RTN","PXCEVFI1",21,0)
 I $P(PXCETEXT,"~",7)]"" D
"RTN","PXCEVFI1",22,0)
 . D @$P(PXCETEXT,"~",7)
"RTN","PXCEVFI1",23,0)
 E  D
"RTN","PXCEVFI1",24,0)
 . I PXCEDIRB'="" S DIR("B")=PXCEDIRB
"RTN","PXCEVFI1",25,0)
 . S DIR(0)=PXCEFILE_",.01OA"
"RTN","PXCEVFI1",26,0)
 . S DIR("A")=$P(PXCETEXT,"~",4)
"RTN","PXCEVFI1",27,0)
 . S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
"RTN","PXCEVFI1",28,0)
 . D ^DIR
"RTN","PXCEVFI1",29,0)
 I X="@" D  G ENDEDIT
"RTN","PXCEVFI1",30,0)
 . N DIRUT
"RTN","PXCEVFI1",31,0)
 . I $P(PXCEAFTR(0),"^",1)="" D
"RTN","PXCEVFI1",32,0)
 .. W !,"There is no entry to delete."
"RTN","PXCEVFI1",33,0)
 .. D WAIT^PXCEHELP
"RTN","PXCEVFI1",34,0)
 . E  D DEL^PXCEVFI2(PXCECAT)
"RTN","PXCEVFI1",35,0)
 I $D(DIRUT),$P(PXCEAFTR(0),"^",1)="" S PXCELOOP=1
"RTN","PXCEVFI1",36,0)
 I $D(DIRUT) S PXCEQUIT=1 Q
"RTN","PXCEVFI1",37,0)
 S (PXCEINP,PXD)=Y
"RTN","PXCEVFI1",38,0)
 S PXCEIN01=X
"RTN","PXCEVFI1",39,0)
 I $P(Y,"^",2)'=PXCEDIRB,$$DUP(PXCEINP) G EDIT01
"RTN","PXCEVFI1",40,0)
 ;--File new CPT code and retrieve IEN
"RTN","PXCEVFI1",41,0)
 I PXCECAT="CPT" D
"RTN","PXCEVFI1",42,0)
 . S PXMDCNT=$$CODM^ICPTCOD(+Y,"^TMP(""PXMODARR"",$J",PXCESOR,+^TMP("PXK",$J,"VST",1,0,"AFTER"))
"RTN","PXCEVFI1",43,0)
 . K ^TMP("PXMODARR",$J)
"RTN","PXCEVFI1",44,0)
 . I $P(PXCEAFTR(0),"^",1)'=""!(PXMDCNT'>0) Q
"RTN","PXCEVFI1",45,0)
 . N PXCEFIEN
"RTN","PXCEVFI1",46,0)
 . D NEWCODE^PXCECPT
"RTN","PXCEVFI1",47,0)
 . S ^TMP("PXK",$J,PXCECATS,1,"IEN")=PXCEFIEN
"RTN","PXCEVFI1",48,0)
 I PXCECAT="PRV",$P(PXCEAFTR(0),"^",1)>0,PXCEDIRB]"" S $P(PXCEAFTR(0),"^",6)=""
"RTN","PXCEVFI1",49,0)
 S $P(PXCEAFTR(0),"^",1)=$P(PXCEINP,"^")
"RTN","PXCEVFI1",50,0)
 K DIR,DA
"RTN","PXCEVFI1",51,0)
 ;following code added per PX*185
"RTN","PXCEVFI1",52,0)
 I $D(XQORNOD(0)) I $P(XQORNOD(0),U,4)="HF" D
"RTN","PXCEVFI1",53,0)
 .N HFIEN,NODE
"RTN","PXCEVFI1",54,0)
 .S HFIEN=$P(PXCEINP,U),NODE=$G(^AUTTHF(HFIEN,0))
"RTN","PXCEVFI1",55,0)
 .Q:'$D(NODE)
"RTN","PXCEVFI1",56,0)
 .I $P(NODE,U,8)'="Y" W !!,"WARNING:  This Health Factor is currently not set to",!?10,"display on a Health Summary report.",!!
"RTN","PXCEVFI1",57,0)
 .K HFIEN,NODE
"RTN","PXCEVFI1",58,0)
 .Q
"RTN","PXCEVFI1",59,0)
 ;
"RTN","PXCEVFI1",60,0)
 ;
"RTN","PXCEVFI1",61,0)
REST S PXCEEND=0
"RTN","PXCEVFI1",62,0)
 F PXCELINE=2:1 S PXCETEXT=$P($T(FORMAT+PXCELINE^@PXCECODE),";;",2) Q:PXCETEXT']""  D  Q:PXCEEND
"RTN","PXCEVFI1",63,0)
 . I $P(PXCETEXT,"~",3)=1214,PXCECAT="SK" Q  ; PX*1*210
"RTN","PXCEVFI1",64,0)
 . I $P(PXCETEXT,"~",3)=1406,PXCECAT="IMM" Q  ; PX*1*210
"RTN","PXCEVFI1",65,0)
 . I $P(PXCETEXT,"~",3)=1401 D  Q:PXCEEND  ; PX*1*210
"RTN","PXCEVFI1",66,0)
 .. I PXCECAT'="IMM" S PXCEEND=1 Q  ; PX*1*210
"RTN","PXCEVFI1",67,0)
 .. I +$G(PXD),'$P($G(^AUTTIMM(+PXD,.5)),"^") S PXCEEND=1 Q  ; PX*1*210
"RTN","PXCEVFI1",68,0)
 . I $P(PXCETEXT,"~",9)]"",$P(PXCETEXT,"~",3)'=80201 S PXCEKEY="" D  Q:PXCEKEY'=1
"RTN","PXCEVFI1",69,0)
 .. S PXCENKEY=$L($P(PXCETEXT,"~",9))
"RTN","PXCEVFI1",70,0)
 .. F PXCEIKEY=1:1:PXCENKEY I PXCEKEYS[$E($P(PXCETEXT,"~",9),PXCEIKEY) S PXCEKEY=1 Q
"RTN","PXCEVFI1",71,0)
 . K DIR,DA,X,Y,C
"RTN","PXCEVFI1",72,0)
 . I $P(PXCETEXT,"~",7)]"" D
"RTN","PXCEVFI1",73,0)
 .. D @$P(PXCETEXT,"~",7)
"RTN","PXCEVFI1",74,0)
 . E  D
"RTN","PXCEVFI1",75,0)
 .. I $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))'="" D
"RTN","PXCEVFI1",76,0)
 ... N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCEVFI1",77,0)
 ... S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
"RTN","PXCEVFI1",78,0)
 ... S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
"RTN","PXCEVFI1",79,0)
 ... S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCEVFI1",80,0)
 .. S DIR(0)=PXCEFILE_","_$P(PXCETEXT,"~",3)_"A"
"RTN","PXCEVFI1",81,0)
 .. S DIR("A")=$P(PXCETEXT,"~",4)
"RTN","PXCEVFI1",82,0)
 .. S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
"RTN","PXCEVFI1",83,0)
 .. D ^DIR
"RTN","PXCEVFI1",84,0)
 .. K DIR,DA
"RTN","PXCEVFI1",85,0)
 .. I X="@" S Y="@"
"RTN","PXCEVFI1",86,0)
 .. E  I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 S:PXCECAT="SIT"!(PXCECAT="APPM")!(PXCECAT="HIST")!(PXCECAT="CPT") PXCEQUIT=1 Q
"RTN","PXCEVFI1",87,0)
 .. S $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^")
"RTN","PXCEVFI1",88,0)
 . I ($P(PXCETEXT,"~",3)=1202!($P(PXCETEXT,"~",3)=1204)) D:+Y>0 PROVIDER^PXCEVFI4(+Y)
"RTN","PXCEVFI1",89,0)
 ;
"RTN","PXCEVFI1",90,0)
ENDEDIT ;
"RTN","PXCEVFI1",91,0)
 Q
"RTN","PXCEVFI1",92,0)
 ;
"RTN","PXCEVFI1",93,0)
DUP(PXCEINP) ; -- Check for dup entries.
"RTN","PXCEVFI1",94,0)
 Q:PXCECAT="SIT"!(PXCECAT="APPM")!(PXCECAT="HIST") 0
"RTN","PXCEVFI1",95,0)
 ;
"RTN","PXCEVFI1",96,0)
 N PXCEDUP,PXCEINDX,X,Y
"RTN","PXCEVFI1",97,0)
 S PXCEDUP=0
"RTN","PXCEVFI1",98,0)
 S PXCEINDX=""
"RTN","PXCEVFI1",99,0)
 F  S PXCEINDX=$O(@(PXCEAUPN_"(""AD"",PXCEVIEN,PXCEINDX)")) Q:'PXCEINDX!PXCEDUP  S:+@(PXCEAUPN_"(PXCEINDX,0)")=+PXCEINP&(PXCEINDX'=PXCEFIEN) PXCEDUP=1
"RTN","PXCEVFI1",100,0)
 I PXCEDUP D
"RTN","PXCEVFI1",101,0)
 . I PXCEDUP
"RTN","PXCEVFI1",102,0)
 . W !,$P(PXCEINP,"^",2)," is already a "_PXCECATT_" for this Encounter."
"RTN","PXCEVFI1",103,0)
 . I PXCECAT="POV" W !!,"Duplicate Diagnosis Not Allowed." Q  ;PX/112
"RTN","PXCEVFI1",104,0)
 . I PXCECAT="CPT",$$GET1^DIQ(357.69,$P(PXCEINP,"^",2),.01)>0 D  Q
"RTN","PXCEVFI1",105,0)
 . . W !,"No duplicate E&M codes allowed."   ;PX/136
"RTN","PXCEVFI1",106,0)
 . I $P($T(FORMAT^@PXCECODE),"~",4) D
"RTN","PXCEVFI1",107,0)
 .. N DIR,DA
"RTN","PXCEVFI1",108,0)
 .. S DIR(0)="Y"
"RTN","PXCEVFI1",109,0)
 .. S DIR("A")="Do you want to add another "_$P(PXCEINP,"^",2)_""
"RTN","PXCEVFI1",110,0)
 .. S DIR("B")="NO"
"RTN","PXCEVFI1",111,0)
 .. D ^DIR
"RTN","PXCEVFI1",112,0)
 .. S PXCEDUP='+Y
"RTN","PXCEVFI1",113,0)
 Q PXCEDUP
"RTN","PXCEVFI1",114,0)
 ;
"RTN","PXCEVIMM")
0^14^B68979486^B56314311
"RTN","PXCEVIMM",1,0)
PXCEVIMM ;ISL/dee,SLC/ajb - Used to edit and display V IMMUNIZATION ;08/11/15  12:48
"RTN","PXCEVIMM",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**27,124,199,201,210**;Aug 12, 1996;Build 11
"RTN","PXCEVIMM",3,0)
 ;;
"RTN","PXCEVIMM",4,0)
 Q
"RTN","PXCEVIMM",5,0)
 ;
"RTN","PXCEVIMM",6,0)
 ;Line with the line label "FORMAT"
"RTN","PXCEVIMM",7,0)
 ;;Long name~File Number~Node Subscripts~Allow Duplicate entries (1=yes, 0=no)~File global name
"RTN","PXCEVIMM",8,0)
 ;     1         2             3                   4                                   5
"RTN","PXCEVIMM",9,0)
 ;
"RTN","PXCEVIMM",10,0)
 ;Following lines:
"RTN","PXCEVIMM",11,0)
 ;;Node~Piece~,Field Number~Edit Label~Display Label~Display Routine~Edit Routine~Help Text for DIR("?")~Set of PXCEKEYS that can Edit~D if Detail Display Only~
"RTN","PXCEVIMM",12,0)
 ;  1  ~  2  ~      3      ~     4    ~        5    ~        6      ~     7      ~       8              ~          9                  ~       10
"RTN","PXCEVIMM",13,0)
 ;The Display & Edit routines are for special cases.
"RTN","PXCEVIMM",14,0)
 ;  (The .01 field cannot have a special edit.)
"RTN","PXCEVIMM",15,0)
 ;
"RTN","PXCEVIMM",16,0)
FORMAT ;;Immunization~9000010.11~0,3,11,12,13,14,15,811,812~0~^AUPNVIMM
"RTN","PXCEVIMM",17,0)
 ;;0~1~.01~Immunization:  ~Immunization:  ~~~~~B
"RTN","PXCEVIMM",18,0)
 ;;12~7~1207~Lot Number:  ~Lot Number:  ~$$DISPLN^PXCEVIMM~~~~D
"RTN","PXCEVIMM",19,0)
 ;;12~2~1202~Ordering Provider:  ~Ordering Provider:  ~~EPROV12^PXCEPRV~~~D
"RTN","PXCEVIMM",20,0)
 ;;12~4~1204~Encounter Provider:  ~Encounter Provider:  ~~EPROV12^PXCEPRV~~~D
"RTN","PXCEVIMM",21,0)
 ;;0~4~.04~Series:  ~Series:  ~~~~~D
"RTN","PXCEVIMM",22,0)
 ;;0~6~.06~Reaction:  ~Reaction:  ~~~~~D
"RTN","PXCEVIMM",23,0)
 ;;0~7~.07~Repeat Contraindicated:  ~Repeat Contraindicated:  ~~ECONTRAI^PXCEVIMM~~~D
"RTN","PXCEVIMM",24,0)
 ;;12~1~1201~Administered Date and Time:  ~Administered Date and Time:  ~~~~~D
"RTN","PXCEVIMM",25,0)
 ;;13~12~1312~Dose:  ~Dose:  ~~~~~D
"RTN","PXCEVIMM",26,0)
 ;;13~13~1313~Dose Units:  ~Dose Units:  ~~~~~D
"RTN","PXCEVIMM",27,0)
 ;;13~2~1302~Route of Administration:  ~Route of Administration:  ~~~~~D
"RTN","PXCEVIMM",28,0)
 ;;13~3~1303~Site of Administration (Body):  ~Site of Administration (Body):  ~~~~~D
"RTN","PXCEVIMM",29,0)
 ;;811~1~81101~Comments:  ~Comments:  ~~~~~D
"RTN","PXCEVIMM",30,0)
 ;;13~4~1304~Primary Diagnosis:  ~Primary Diagnosis:  ~$$DISPLY01^PXCEPOV~EPOV^PXCEVIMM~~S~
"RTN","PXCEVIMM",31,0)
 ;;3~2~.01~Other Diagnosis:  ~Other Diagnosis:  ~$$DISPLY01^PXCEPOV~EPOV2^PXCEVIMM~~S~
"RTN","PXCEVIMM",32,0)
 ;;14~1~1401~Results:  ~Results:  ~~~~~D
"RTN","PXCEVIMM",33,0)
 ;;14~2~1402~Reading:  ~Reading:  ~~~~~D
"RTN","PXCEVIMM",34,0)
 ;;14~3~1403~Date and Time Read:  ~Date/Time Read:  ~~~~~D
"RTN","PXCEVIMM",35,0)
 ;;14~4~1404~Reader:  ~Reader:  ~~EPROV12^PXCEPRV~~~D
"RTN","PXCEVIMM",36,0)
 ;;14~5~1405~Date and Time Reading Recorded:  ~Reading Recorded:  ~~~~~D
"RTN","PXCEVIMM",37,0)
 ;;14~6~1406~Hours Read Post-Innoculation:  ~Hours Read Post-Innoculation:  ~~~~~D
"RTN","PXCEVIMM",38,0)
 ;;15~1~1501~Reading Comments:  ~Reading Comments:  ~~~~~D
"RTN","PXCEVIMM",39,0)
 ;;
"RTN","PXCEVIMM",40,0)
 ;
"RTN","PXCEVIMM",41,0)
 ;Cannot ask work processing
"RTN","PXCEVIMM",42,0)
 ;;12~2~1202~Ordering Provider:  ~Ordering Provider:  ~~EPROV12^PXCEPRV~~~D
"RTN","PXCEVIMM",43,0)
 ;
"RTN","PXCEVIMM",44,0)
 ;The interface for AICS to get list on form for help.
"RTN","PXCEVIMM",45,0)
INTRFACE ;;PX SELECT IMMUNIZATIONS
"RTN","PXCEVIMM",46,0)
 ;
"RTN","PXCEVIMM",47,0)
 ;********************************
"RTN","PXCEVIMM",48,0)
 ;Special cases for display.
"RTN","PXCEVIMM",49,0)
 ;
"RTN","PXCEVIMM",50,0)
 ;********************************
"RTN","PXCEVIMM",51,0)
 ;Special cases for edit.
"RTN","PXCEVIMM",52,0)
 ;
"RTN","PXCEVIMM",53,0)
ECONTRAI ;
"RTN","PXCEVIMM",54,0)
 I $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))'="" D
"RTN","PXCEVIMM",55,0)
 . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCEVIMM",56,0)
 . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
"RTN","PXCEVIMM",57,0)
 . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
"RTN","PXCEVIMM",58,0)
 . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCEVIMM",59,0)
 E  S DIR("B")="NO"
"RTN","PXCEVIMM",60,0)
 S DIR(0)=PXCEFILE_","_$P(PXCETEXT,"~",3)_"A"
"RTN","PXCEVIMM",61,0)
 S DIR("A")=$P(PXCETEXT,"~",4)
"RTN","PXCEVIMM",62,0)
 S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
"RTN","PXCEVIMM",63,0)
 D ^DIR
"RTN","PXCEVIMM",64,0)
 K DIR,DA
"RTN","PXCEVIMM",65,0)
 I X="@" S Y="@"
"RTN","PXCEVIMM",66,0)
 E  I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 Q
"RTN","PXCEVIMM",67,0)
 S $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^")
"RTN","PXCEVIMM",68,0)
 Q
"RTN","PXCEVIMM",69,0)
 ;
"RTN","PXCEVIMM",70,0)
ELOT ;
"RTN","PXCEVIMM",71,0)
 I $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))'="" D
"RTN","PXCEVIMM",72,0)
 . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCEVIMM",73,0)
 . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
"RTN","PXCEVIMM",74,0)
 . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
"RTN","PXCEVIMM",75,0)
 . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCEVIMM",76,0)
 S DIR(0)="PAO^9999999.41:EM^K:$P(^(0),U,3)'=0!($P(^(0),U,4)'=$P(PXCEAFTR(0),U,1)) X"
"RTN","PXCEVIMM",77,0)
 S DIR("A")=$P(PXCETEXT,"~",4)
"RTN","PXCEVIMM",78,0)
 S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
"RTN","PXCEVIMM",79,0)
 D ^DIR
"RTN","PXCEVIMM",80,0)
 K DIR,DA
"RTN","PXCEVIMM",81,0)
 I X="@" S Y="@"
"RTN","PXCEVIMM",82,0)
 E  I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 Q
"RTN","PXCEVIMM",83,0)
 S:Y'<0 $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^")
"RTN","PXCEVIMM",84,0)
 Q
"RTN","PXCEVIMM",85,0)
 ;
"RTN","PXCEVIMM",86,0)
EPOV ;Edit the Associated DX
"RTN","PXCEVIMM",87,0)
 N PXACS,PXACSREC,PXDATE,PXDEF,PXDXASK,PXXX
"RTN","PXCEVIMM",88,0)
 S PXDATE=$S($D(PXCEVIEN)=1:$$CSDATE^PXDXUTL(PXCEVIEN),$D(PXCEAPDT)=1:PXCEAPDT,1:DT)
"RTN","PXCEVIMM",89,0)
 S PXACSREC=$$ACTDT^PXDXUTL(PXDATE),PXACS=$P(PXACSREC,"^",3)
"RTN","PXCEVIMM",90,0)
 I PXACS["-" S PXACS=$P(PXACS,"-",1,2)
"RTN","PXCEVIMM",91,0)
 I $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))'="" D
"RTN","PXCEVIMM",92,0)
 .N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCEVIMM",93,0)
 .S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
"RTN","PXCEVIMM",94,0)
 .S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
"RTN","PXCEVIMM",95,0)
 .S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCEVIMM",96,0)
 I $P(PXACSREC,U,1)'="ICD" D
"RTN","PXCEVIMM",97,0)
 . S PXDXASK=PXACS_" "_$P(PXCETEXT,"~",4)
"RTN","PXCEVIMM",98,0)
 . S PXDEF=$G(DIR("B")),PXAGAIN=0 D ^PXDSLK I PXXX=-1 S Y=-1 Q
"RTN","PXCEVIMM",99,0)
 . I PXXX="@" S Y="@" Q
"RTN","PXCEVIMM",100,0)
 . S Y=$P($$ICDDATA^ICDXCODE("DIAG",$P($P(PXXX,U,1),";",2),PXDATE,"E"),U,1)
"RTN","PXCEVIMM",101,0)
 I $P(PXACSREC,U,1)="ICD" D
"RTN","PXCEVIMM",102,0)
 . S DIR(0)=PXCEFILE_","_$P(PXCETEXT,"~",3)_"A"
"RTN","PXCEVIMM",103,0)
 . S DIR("A")=PXACS_" "_$P(PXCETEXT,"~",4)
"RTN","PXCEVIMM",104,0)
 . S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
"RTN","PXCEVIMM",105,0)
 . D ^DIR
"RTN","PXCEVIMM",106,0)
 K DIR,DA
"RTN","PXCEVIMM",107,0)
 I X="@" S Y="@" S $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^") Q
"RTN","PXCEVIMM",108,0)
 I $D(DTOUT)!$D(DUOUT) S PXCEEND=1,PXCEQUIT=1 Q
"RTN","PXCEVIMM",109,0)
 I +Y'>0 S PXCEEND=1 Q  ;S:$P(PXCETEXT,"~",3)=".08" PXCEQUIT=1 Q
"RTN","PXCEVIMM",110,0)
 ;See if this diagnosis is in the PXCEAFTR(0)
"RTN","PXCEVIMM",111,0)
 I $P(PXCETEXT,"~",2)'=1,(+Y=$P($G(PXCEAFTR(80)),"^",1)) S PXCEEND=1
"RTN","PXCEVIMM",112,0)
 I $P(PXCETEXT,"~",2)'=2,(+Y=$P($G(PXCEAFTR(80)),"^",2)) S PXCEEND=1
"RTN","PXCEVIMM",113,0)
 I $P(PXCETEXT,"~",2)'=3,(+Y=$P($G(PXCEAFTR(80)),"^",3)) S PXCEEND=1
"RTN","PXCEVIMM",114,0)
 I $P(PXCETEXT,"~",2)'=4,(+Y=$P($G(PXCEAFTR(80)),"^",4)) S PXCEEND=1
"RTN","PXCEVIMM",115,0)
 I $P(PXCETEXT,"~",2)'=5,(+Y=$P($G(PXCEAFTR(80)),"^",5)) S PXCEEND=1
"RTN","PXCEVIMM",116,0)
 I $P(PXCETEXT,"~",2)'=6,(+Y=$P($G(PXCEAFTR(80)),"^",6)) S PXCEEND=1
"RTN","PXCEVIMM",117,0)
 I $P(PXCETEXT,"~",2)'=7,(+Y=$P($G(PXCEAFTR(80)),"^",7)) S PXCEEND=1
"RTN","PXCEVIMM",118,0)
 I $P(PXCETEXT,"~",2)'=8,(+Y=$P($G(PXCEAFTR8(80)),"^",8)) S PXCEEND=1
"RTN","PXCEVIMM",119,0)
 ;
"RTN","PXCEVIMM",120,0)
 ; check for duplicate diagnosis in OTHER DIAGNOSIS
"RTN","PXCEVIMM",121,0)
 N DX D:+$G(PXCEFIEN)
"RTN","PXCEVIMM",122,0)
 . N CNT S CNT=0 F  S CNT=$O(^AUPNVIMM(PXCEFIEN,3,CNT)) Q:'+CNT  D
"RTN","PXCEVIMM",123,0)
 . . S DX(^AUPNVIMM(PXCEFIEN,3,CNT,0))=""
"RTN","PXCEVIMM",124,0)
 I +$D(DX(+Y)) S PXCEEND=1
"RTN","PXCEVIMM",125,0)
 ;
"RTN","PXCEVIMM",126,0)
 I $G(PXCEEND)=1 W !,$C(7),"Duplicate Diagnosis is not allowed." D WAIT^PXCEHELP Q
"RTN","PXCEVIMM",127,0)
 S $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^")
"RTN","PXCEVIMM",128,0)
 D:+Y>0 DIAGNOS^PXCEVFI4(+Y)
"RTN","PXCEVIMM",129,0)
 Q
"RTN","PXCEVIMM",130,0)
EPOV2 ; edit OTHER DIAGNOSIS
"RTN","PXCEVIMM",131,0)
 Q:'+$G(PXCEFIEN)
"RTN","PXCEVIMM",132,0)
 N PXACS,PXACSREC,PXDATE,PXDEF,PXDXASK,PXXX
"RTN","PXCEVIMM",133,0)
 S PXDATE=$S($D(PXCEVIEN)=1:$$CSDATE^PXDXUTL(PXCEVIEN),$D(PXCEAPDT)=1:PXCEAPDT,1:DT)
"RTN","PXCEVIMM",134,0)
 S PXACSREC=$$ACTDT^PXDXUTL(PXDATE),PXACS=$P(PXACSREC,"^",3)
"RTN","PXCEVIMM",135,0)
 I PXACS["-" S PXACS=$P(PXACS,"-",1,2)
"RTN","PXCEVIMM",136,0)
 ; get multiple diagnosis
"RTN","PXCEVIMM",137,0)
 N CNT,DX,DXS S CNT=0 F  S CNT=$O(^AUPNVIMM(PXCEFIEN,3,CNT)) Q:'+CNT  D
"RTN","PXCEVIMM",138,0)
 . S DX(CNT)=^AUPNVIMM(PXCEFIEN,3,CNT,0)
"RTN","PXCEVIMM",139,0)
 . S DXS(DX(CNT))=""
"RTN","PXCEVIMM",140,0)
 I '$D(DX) S DX(1)="" ; if no entries, show empty entry to allow adding
"RTN","PXCEVIMM",141,0)
 I $P(PXACSREC,U,1)="ICD" D
"RTN","PXCEVIMM",142,0)
 . N DIR S DIR(0)=PXCEFILE_"3,"_$P(PXCETEXT,"~",3)_"A"
"RTN","PXCEVIMM",143,0)
 . S DIR("A")=PXACS_" "_$P(PXCETEXT,"~",4)
"RTN","PXCEVIMM",144,0)
 . S CNT=0 F  S CNT=$O(DX(CNT)) Q:'+CNT!($D(DTOUT)!($D(DUOUT)))  D
"RTN","PXCEVIMM",145,0)
 . . N DA,X,Y
"RTN","PXCEVIMM",146,0)
 . . S DIR("B")=$$EXTERNAL^DILFD(PXCEFILE_3,".01","",DX(CNT),"PXCEDILF")
"RTN","PXCEVIMM",147,0)
 . . D ^DIR Q:$D(DTOUT)!$D(DUOUT)  Q:X=""
"RTN","PXCEVIMM",148,0)
 . . I X="@" W ! I +$$READ("YE","Are you sure you want to remove this entry","NO") D DELDX(CNT) Q
"RTN","PXCEVIMM",149,0)
 . . I +$D(DXS(+Y)) W:Y(0)'=DIR("B") !!,$C(7),"Entry matches Other Diagnosis.  Duplicate Diagnosis is not allowed." D:Y(0)'=DIR("B") WAIT^PXCEHELP Q  ; quit if entry already exists
"RTN","PXCEVIMM",150,0)
 . . I +Y=$P($G(^AUPNVIMM(PXCEFIEN,13)),U,4) D  Q  ; quit if entry matches primary diagnosis
"RTN","PXCEVIMM",151,0)
 . . . W !!,$C(7),"Entry matches Primary Diagnosis.  Duplicate Diagnosis is not allowed." D WAIT^PXCEHELP
"RTN","PXCEVIMM",152,0)
 . . I Y(0)'=DIR("B") D  ; ask to overwrite or add new entry
"RTN","PXCEVIMM",153,0)
 . . . I DIR("B")'="" N ANS W ! S ANS=$$READ("SA^A:ADD;R:REPLACE","Do you want to ADD a new entry or REPLACE the current entry? ","ADD") W !
"RTN","PXCEVIMM",154,0)
 . . . I DIR("B")="" S ANS="A" ; if no current entry, always add
"RTN","PXCEVIMM",155,0)
 . . . I $P(ANS,U)="A"!($P(ANS,U)="R") D  Q
"RTN","PXCEVIMM",156,0)
 . . . . N FDA,FDAIEN,ERRMSG,IEN
"RTN","PXCEVIMM",157,0)
 . . . . S IEN=$S($P(ANS,U)="A":"+1,"_PXCEFIEN_",",1:CNT_","_PXCEFIEN_",")
"RTN","PXCEVIMM",158,0)
 . . . . S FDA(PXCEFILE_3,IEN,.01)=+Y
"RTN","PXCEVIMM",159,0)
 . . . . D DIAGNOS^PXCEVFI4(+Y,1)
"RTN","PXCEVIMM",160,0)
 . . . . I '+$G(PXCEQUIT) D UPDATE^DIE("","FDA","FDAIEN","ERRMSG")
"RTN","PXCEVIMM",161,0)
 Q
"RTN","PXCEVIMM",162,0)
DELDX(DA) ; delete OTHER DIAGNOSIS
"RTN","PXCEVIMM",163,0)
 K DXS(DX(DA)),DX(DA)
"RTN","PXCEVIMM",164,0)
 S DA(1)=PXCEFIEN,DIK="^AUPNVIMM("_DA(1)_",3," D ^DIK W !!,"Entry successfully removed." D WAIT^PXCEHELP
"RTN","PXCEVIMM",165,0)
 Q
"RTN","PXCEVIMM",166,0)
 ;
"RTN","PXCEVIMM",167,0)
READ(TYPE,PROMPT,DEFAULT,HELP,SCREEN) ;
"RTN","PXCEVIMM",168,0)
 N DIR,X,Y,DUOUT,DTOUT,DIRUT S DIR(0)=TYPE
"RTN","PXCEVIMM",169,0)
 I $D(SCREEN) S DIR("S")=SCREEN
"RTN","PXCEVIMM",170,0)
 I $G(PROMPT)]"" S DIR("A")=PROMPT
"RTN","PXCEVIMM",171,0)
 I $G(DEFAULT)]"" S DIR("B")=DEFAULT
"RTN","PXCEVIMM",172,0)
 I $D(HELP) S DIR("?")=HELP
"RTN","PXCEVIMM",173,0)
 D ^DIR
"RTN","PXCEVIMM",174,0)
 I $G(X)="@" S Y="@" G READX
"RTN","PXCEVIMM",175,0)
 I Y]"",($L($G(Y),U)'=2) S Y=Y_U_$G(Y(0),Y)
"RTN","PXCEVIMM",176,0)
READX Q Y
"RTN","PXCEVIMM",177,0)
 ;
"RTN","PXCEVIMM",178,0)
 ;********************************
"RTN","PXCEVIMM",179,0)
 ;Display text for the .01 field which is a pointer to Immunization.
"RTN","PXCEVIMM",180,0)
 ;(Must have is called by ASK^PXCEVFI2 and DEL^PXCEVFI2.)
"RTN","PXCEVIMM",181,0)
DISPLY01(PXCEIMM) ;
"RTN","PXCEVIMM",182,0)
 N DIERR,PXCEDILF,PXCEINT,PXCEEXT
"RTN","PXCEVIMM",183,0)
 S PXCEINT=$P(PXCEIMM,"^",1)
"RTN","PXCEVIMM",184,0)
 S PXCEEXT=$$EXTERNAL^DILFD(9000010.11,.01,"",PXCEINT,"PXCEDILF")
"RTN","PXCEVIMM",185,0)
 Q $S('$D(DIERR):PXCEEXT,1:PXCEINT)
"RTN","PXCEVIMM",186,0)
 ;
"RTN","PXCEVIMM",187,0)
DISPLN(PXCEINT) ; display lot number with manufacturer
"RTN","PXCEVIMM",188,0)
 N PXCEDILF,PXCEEXT,PXV2,PXVMAN
"RTN","PXCEVIMM",189,0)
 S PXCEEXT=$$EXTERNAL^DILFD(9000010.11,1207,"",PXCEINT,"PXCEDILF")
"RTN","PXCEVIMM",190,0)
 S PXV2=$P(^AUTTIML(PXCEINT,0),"^",2),PXVMAN=$$EXTERNAL^DILFD(9999999.41,.02,"",PXV2,"PXCEDILF")
"RTN","PXCEVIMM",191,0)
 Q $S('$D(DIERR):PXCEEXT_"     "_PXVMAN,1:PXCEINT)
"RTN","PXCEVIMM",192,0)
 ;
"RTN","PXKENC")
0^4^B29230371^B23516097
"RTN","PXKENC",1,0)
PXKENC ;ISL/dee,ESW - Builds the array of all encounter data for the event point ;07/07/15  10:43
"RTN","PXKENC",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**15,22,73,108,143,183,210**;Aug 12, 1996;Build 11
"RTN","PXKENC",3,0)
 Q
"RTN","PXKENC",4,0)
 ;
"RTN","PXKENC",5,0)
GETENC(DFN,ENCDT,HLOC) ;Get all of the encounter data
"RTN","PXKENC",6,0)
 ;Parameters:
"RTN","PXKENC",7,0)
 ;  DFN    Pointer to the patient (#9000001)
"RTN","PXKENC",8,0)
 ;  ENCDT  Date/Time of the encounter in Fileman format
"RTN","PXKENC",9,0)
 ;  HLOC   Pointer to Hospital Location (#44)
"RTN","PXKENC",10,0)
 ;
"RTN","PXKENC",11,0)
 ;Returns:
"RTN","PXKENC",12,0)
 ;  -2  if called incorrectly
"RTN","PXKENC",13,0)
 ;  -1  if could not find encounter
"RTN","PXKENC",14,0)
 ;  >0  Visit ien(s) separated by ^
"RTN","PXKENC",15,0)
 ;
"RTN","PXKENC",16,0)
 ;  The encounter is returned in the array
"RTN","PXKENC",17,0)
 ;    ^TMP("PXKENC",$J,pointer to visit)
"RTN","PXKENC",18,0)
 ;  may contain more than one visit
"RTN","PXKENC",19,0)
 ;
"RTN","PXKENC",20,0)
 N VISITIEN,REVDT,RETURN
"RTN","PXKENC",21,0)
 K ^TMP("PXKENC",$J)
"RTN","PXKENC",22,0)
 S RETURN=-1
"RTN","PXKENC",23,0)
 Q:DFN'>0!(ENCDT<1800000)!(HLOC'>0) -2
"RTN","PXKENC",24,0)
 S REVDT=(9999999-$P(+ENCDT,".",1))_$S($P(+ENCDT,".",2)'="":"."_$P(+ENCDT,".",2),1:"")
"RTN","PXKENC",25,0)
 S VISITIEN=0
"RTN","PXKENC",26,0)
 F  S VISITIEN=$O(^AUPNVSIT("AA",+DFN,REVDT,VISITIEN)) Q:'VISITIEN  D
"RTN","PXKENC",27,0)
 . I $P($G(^AUPNVSIT(VISITIEN,0)),"^",22)=HLOC,"C~S"'[$P($G(^AUPNVSIT(VISITIEN,150)),"^",3) D
"RTN","PXKENC",28,0)
 .. D ENCEVENT(VISITIEN,1)
"RTN","PXKENC",29,0)
 .. I RETURN<1 S RETURN=VISITIEN
"RTN","PXKENC",30,0)
 .. E  S RETURN=RETURN_"^"_VISITIEN
"RTN","PXKENC",31,0)
 Q RETURN
"RTN","PXKENC",32,0)
 ;
"RTN","PXKENC",33,0)
ENCEVENT(VISITIEN,DONTKILL) ;Create the ^TMP("PXKENC",$J, array of all the
"RTN","PXKENC",34,0)
 ;  information about one encounter.
"RTN","PXKENC",35,0)
 ;Parameters:
"RTN","PXKENC",36,0)
 ;  VISITIEN  Pointer to the Visit (#9000010)
"RTN","PXKENC",37,0)
 ;  DONOTKILL is 1 if the output array is not to be killed before used
"RTN","PXKENC",38,0)
 ;            and 0 or null if the array is to be killed (cleaned out)
"RTN","PXKENC",39,0)
 ;
"RTN","PXKENC",40,0)
 ;  The encounter is returned in the array
"RTN","PXKENC",41,0)
 ;    ^TMP("PXKENC",$J,pointer to visit)
"RTN","PXKENC",42,0)
 ;
"RTN","PXKENC",43,0)
 I $G(VISITIEN)'>0 Q  ;PX/183
"RTN","PXKENC",44,0)
 I '$D(^AUPNVSIT(VISITIEN)) Q
"RTN","PXKENC",45,0)
 K:'$G(DONTKILL) ^TMP("PXKENC",$J)
"RTN","PXKENC",46,0)
 N PXKCNT,PXKROOT
"RTN","PXKENC",47,0)
 S PXKROOT=$NA(@("^TMP(""PXKENC"",$J,"_VISITIEN_")"))
"RTN","PXKENC",48,0)
 ;
"RTN","PXKENC",49,0)
 N IEN,FILE,VFILE,FILESTR,PXKNODE
"RTN","PXKENC",50,0)
 F FILE="SIT","CSTP","PRV","POV","CPT","TRT","IMM","PED","SK","HF","XAM" D
"RTN","PXKENC",51,0)
 . S FILESTR=$S(FILE="SIT":"VST",1:FILE)
"RTN","PXKENC",52,0)
 . S VFILE=$P($T(GLOBAL^@("PXKF"_$S(FILE="SIT":"VST",FILE="CSTP":"VST",1:FILE))),";;",2)
"RTN","PXKENC",53,0)
 . I FILE="SIT" D
"RTN","PXKENC",54,0)
 .. S IEN=VISITIEN
"RTN","PXKENC",55,0)
 .. S PXKNODE=""
"RTN","PXKENC",56,0)
 .. F  S PXKNODE=$O(@VFILE@(IEN,PXKNODE)) Q:PXKNODE=""  D
"RTN","PXKENC",57,0)
 ... S @PXKROOT@(FILESTR,IEN,PXKNODE)=@VFILE@(IEN,PXKNODE)
"RTN","PXKENC",58,0)
 . E  D
"RTN","PXKENC",59,0)
 .. I FILE="PRV" D EVALD(VISITIEN,PXKROOT,VFILE,FILESTR)
"RTN","PXKENC",60,0)
 .. I FILE'="PRV" S IEN="" F  S IEN=$O(@VFILE@("AD",VISITIEN,IEN)) Q:'IEN  D
"RTN","PXKENC",61,0)
 ... I FILE="CSTP","SC"'[$P($G(@VFILE@(IEN,150)),"^",3) Q
"RTN","PXKENC",62,0)
 ... S PXKNODE=""
"RTN","PXKENC",63,0)
 ... F  S PXKNODE=$O(@VFILE@(IEN,PXKNODE)) Q:PXKNODE=""  D:PXKNODE'=801
"RTN","PXKENC",64,0)
 .... ;for cpt modifiers
"RTN","PXKENC",65,0)
 .... I FILE="CPT",PXKNODE=1 D  Q
"RTN","PXKENC",66,0)
 ..... S @PXKROOT@(FILESTR,IEN,PXKNODE,0)=$G(@VFILE@(IEN,PXKNODE,0))
"RTN","PXKENC",67,0)
 ..... N SUBIEN
"RTN","PXKENC",68,0)
 ..... S SUBIEN=0
"RTN","PXKENC",69,0)
 ..... F  S SUBIEN=$O(@VFILE@(IEN,PXKNODE,SUBIEN)) Q:SUBIEN=""  D
"RTN","PXKENC",70,0)
 ...... S @PXKROOT@(FILESTR,IEN,PXKNODE,SUBIEN,0)=$G(@VFILE@(IEN,PXKNODE,SUBIEN,0))
"RTN","PXKENC",71,0)
 .... ;for immunizatin multiples
"RTN","PXKENC",72,0)
 .... I FILE="IMM",PXKNODE?1(1"2",1"3",1"11") D  Q
"RTN","PXKENC",73,0)
 ..... N SUBIEN
"RTN","PXKENC",74,0)
 ..... S SUBIEN=0
"RTN","PXKENC",75,0)
 ..... F  S SUBIEN=$O(@VFILE@(IEN,PXKNODE,SUBIEN)) Q:'SUBIEN  D
"RTN","PXKENC",76,0)
 ...... S @PXKROOT@(FILESTR,IEN,PXKNODE,SUBIEN,0)=$G(@VFILE@(IEN,PXKNODE,SUBIEN,0))
"RTN","PXKENC",77,0)
 .... ;
"RTN","PXKENC",78,0)
 .... S @PXKROOT@(FILESTR,IEN,PXKNODE)=$G(@VFILE@(IEN,PXKNODE))
"RTN","PXKENC",79,0)
 Q
"RTN","PXKENC",80,0)
EVALD(VISITIEN,PXKROOT,VFILE,FILESTR) ;evaluation for duplicate providers
"RTN","PXKENC",81,0)
 N CNT,PR,PRS,PS,PP,PRV,STR
"RTN","PXKENC",82,0)
 S IEN="",CNT=0
"RTN","PXKENC",83,0)
 F  S IEN=$O(@VFILE@("AD",VISITIEN,IEN)) Q:'IEN  D
"RTN","PXKENC",84,0)
 .S STR=@VFILE@(IEN,0),PR=+STR,PS=$P(STR,U,4)
"RTN","PXKENC",85,0)
 .I PS="P",'CNT S PRV=PR,CNT=1 D PXKNODE(VFILE,FILESTR,IEN,PXKROOT)
"RTN","PXKENC",86,0)
 .I PS="S" S PRS(PR,IEN)="" D PXKNODE(VFILE,FILESTR,IEN,PXKROOT)
"RTN","PXKENC",87,0)
 .Q
"RTN","PXKENC",88,0)
 S PR="" F  S PR=$O(PRS(PR)) Q:PR=""  S IEN="" D
"RTN","PXKENC",89,0)
 .F PP=1:1 S IEN=$O(PRS(PR,IEN)) Q:IEN=""  D
"RTN","PXKENC",90,0)
 ..I PR=$G(PRV) K @PXKROOT@(FILESTR,IEN) Q
"RTN","PXKENC",91,0)
 ..I PP>1 K @PXKROOT@(FILESTR,IEN)
"RTN","PXKENC",92,0)
 Q
"RTN","PXKENC",93,0)
PXKNODE(VFILE,FILESTR,IEN,PXKROOT) ;
"RTN","PXKENC",94,0)
 N STRR S PXKNODE=""
"RTN","PXKENC",95,0)
 F  S PXKNODE=$O(@VFILE@(IEN,PXKNODE)) Q:PXKNODE=""  D:PXKNODE'=801
"RTN","PXKENC",96,0)
 . I $E($P($P(PXKROOT,","),"(",2),2,7)="PXKENC" D
"RTN","PXKENC",97,0)
 ..; ENCEVENT called
"RTN","PXKENC",98,0)
 .. S @PXKROOT@(FILESTR,IEN,PXKNODE)=$G(@VFILE@(IEN,PXKNODE))
"RTN","PXKENC",99,0)
 . I $P(PXKROOT,"""",2)="PXKCO",'$D(@PXKROOT@(FILESTR,IEN)) D
"RTN","PXKENC",100,0)
 ..; COEVENT called
"RTN","PXKENC",101,0)
 .. F STRR="BEFORE","AFTER" D
"RTN","PXKENC",102,0)
 ... S @PXKROOT@(FILESTR,IEN,PXKNODE,STRR)=$G(@VFILE@(IEN,PXKNODE))
"RTN","PXKENC",103,0)
 Q
"RTN","PXKENC",104,0)
 ;
"RTN","PXKENC",105,0)
COEVENT(VISITIEN) ;Add to the ^TMP("PXKCO",$J, array all of the
"RTN","PXKENC",106,0)
 ;   information that is not already there.
"RTN","PXKENC",107,0)
 I '$D(^AUPNVSIT(VISITIEN)) Q
"RTN","PXKENC",108,0)
 N PXKCNT,PXKROOT
"RTN","PXKENC",109,0)
 S PXKROOT=$NA(@("^TMP(""PXKCO"",$J,"_VISITIEN_")"))
"RTN","PXKENC",110,0)
 ;
"RTN","PXKENC",111,0)
 N IEN,FILE,VFILE,PXKNODE
"RTN","PXKENC",112,0)
 F FILE="CSTP","PRV","POV","CPT","TRT","IMM","PED","SK","HF","XAM" D
"RTN","PXKENC",113,0)
 . S VFILE=$P($T(GLOBAL^@("PXKF"_$S(FILE="CSTP":"VST",1:FILE))),";;",2)
"RTN","PXKENC",114,0)
 . I FILE="PRV" D EVALD(VISITIEN,PXKROOT,VFILE,FILE)
"RTN","PXKENC",115,0)
 . I FILE'="PRV" S IEN="" F  S IEN=$O(@VFILE@("AD",VISITIEN,IEN)) Q:'IEN  D
"RTN","PXKENC",116,0)
 .. I FILE="CSTP","SC"'[$P($G(@VFILE@(IEN,150)),"^",3) Q
"RTN","PXKENC",117,0)
 .. S PXKNODE=""
"RTN","PXKENC",118,0)
 .. I '$D(@PXKROOT@(FILE,IEN)) D
"RTN","PXKENC",119,0)
 ... F  S PXKNODE=$O(@VFILE@(IEN,PXKNODE)) Q:PXKNODE=""  D:PXKNODE'=801
"RTN","PXKENC",120,0)
 .... ;
"RTN","PXKENC",121,0)
 .... I FILE="IMM",PXKNODE?1(1"2",1"3",1"11") D  Q
"RTN","PXKENC",122,0)
 ..... N SUBIEN,VAL
"RTN","PXKENC",123,0)
 ..... S SUBIEN=0
"RTN","PXKENC",124,0)
 ..... F  S SUBIEN=$O(@VFILE@(IEN,PXKNODE,SUBIEN)) Q:'SUBIEN  D
"RTN","PXKENC",125,0)
 ...... S VAL=$G(@VFILE@(IEN,PXKNODE,SUBIEN,0))
"RTN","PXKENC",126,0)
 ...... S @PXKROOT@(FILE,IEN,PXKNODE,"BEFORE",SUBIEN)=VAL
"RTN","PXKENC",127,0)
 ...... S @PXKROOT@(FILE,IEN,PXKNODE,"AFTER",SUBIEN)=VAL
"RTN","PXKENC",128,0)
 .... ;
"RTN","PXKENC",129,0)
 .... I FILE="CPT",PXKNODE=1 D  Q
"RTN","PXKENC",130,0)
 ..... N SUBIEN,MOD
"RTN","PXKENC",131,0)
 ..... S SUBIEN=0
"RTN","PXKENC",132,0)
 ..... F  S SUBIEN=$O(@VFILE@(IEN,PXKNODE,SUBIEN)) Q:'SUBIEN  D
"RTN","PXKENC",133,0)
 ...... S MOD=@VFILE@(IEN,PXKNODE,SUBIEN,0)
"RTN","PXKENC",134,0)
 ...... S @PXKROOT@(FILE,IEN,PXKNODE,"BEFORE",MOD)=""
"RTN","PXKENC",135,0)
 ...... S @PXKROOT@(FILE,IEN,PXKNODE,"AFTER",MOD)=""
"RTN","PXKENC",136,0)
 .... ;
"RTN","PXKENC",137,0)
 .... S @PXKROOT@(FILE,IEN,PXKNODE,"BEFORE")=$G(@VFILE@(IEN,PXKNODE))
"RTN","PXKENC",138,0)
 .... S @PXKROOT@(FILE,IEN,PXKNODE,"AFTER")=$G(@VFILE@(IEN,PXKNODE))
"RTN","PXKENC",139,0)
 Q
"RTN","PXKENC",140,0)
 ;
"RTN","PXKFIMM")
0^28^B4427968^B2843857
"RTN","PXKFIMM",1,0)
PXKFIMM ;ISL/JVS,SLC/ajb - Fields for V IMMUNIZATIONS file ;08/10/15  14:56
"RTN","PXKFIMM",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**22,124,201,209,210**;Aug 12, 1996;Build 11
"RTN","PXKFIMM",3,0)
 ;
"RTN","PXKFIMM",4,0)
 ;  Adding or Editing of data in a particular field can be controlled
"RTN","PXKFIMM",5,0)
 ;by adding a ~ as a delimiter and the letters A and/or E to the
"RTN","PXKFIMM",6,0)
 ;end of the line of text which represents what could be added
"RTN","PXKFIMM",7,0)
 ;to the DR string in a DIE call.
"RTN","PXKFIMM",8,0)
 ; 1. If none or all three(~AE) of these characters are added then
"RTN","PXKFIMM",9,0)
 ;    the data in this field can be either added or edited.
"RTN","PXKFIMM",10,0)
 ; 2. If only the ~ is added then the data in this field can be
"RTN","PXKFIMM",11,0)
 ;    neither added or edited.
"RTN","PXKFIMM",12,0)
 ; 3. IF only the ~A is added then the data can only be added to
"RTN","PXKFIMM",13,0)
 ;    the file for this field but not edited.
"RTN","PXKFIMM",14,0)
 ; 4. If only the ~E is added the the data can only be edited in
"RTN","PXKFIMM",15,0)
 ;    this file for this field. (not a likely possibility)
"RTN","PXKFIMM",16,0)
 ;
"RTN","PXKFIMM",17,0)
 ; The word "OPTION" in front of the line of text below tells the 
"RTN","PXKFIMM",18,0)
 ;software to determine,based on the data, the appropriateness
"RTN","PXKFIMM",19,0)
 ;of using either a "///" or "////" stuff in a DIE call.
"RTN","PXKFIMM",20,0)
 ;
"RTN","PXKFIMM",21,0)
 ; The information on line tag 0 $P(,," * ",1) are the piece numbers
"RTN","PXKFIMM",22,0)
 ;of the fields on the zero node that are required by the data
"RTN","PXKFIMM",23,0)
 ;dictionary and are checked for to determine if enough data is present
"RTN","PXKFIMM",24,0)
 ;to proceed without any errors. $P(,," * ",2) are the nodes and
"RTN","PXKFIMM",25,0)
 ;piece numbers of the fields used to determine duplicates in the
"RTN","PXKFIMM",26,0)
 ;file (node+piece (eg. 12+4)). $P(,," * ",3) is a flag use to
"RTN","PXKFIMM",27,0)
 ;determine if duplicates are allowed in this visit file. 
"RTN","PXKFIMM",28,0)
 ;If it is set to 0 then no duplicate checks will occur. If it is
"RTN","PXKFIMM",29,0)
 ;set to 1 then the file will be checked for duplicates based on
"RTN","PXKFIMM",30,0)
 ;the information in $P 2.
"RTN","PXKFIMM",31,0)
 ;
"RTN","PXKFIMM",32,0)
 ; The following is the file's global name.  Each global must have a
"RTN","PXKFIMM",33,0)
 ;unique name and can not have any subscripts as part of the global root.
"RTN","PXKFIMM",34,0)
GLOBAL ;;^AUPNVIMM
"RTN","PXKFIMM",35,0)
 ;
"RTN","PXKFIMM",36,0)
EN1 ;
"RTN","PXKFIMM",37,0)
 S PXKER=""
"RTN","PXKFIMM",38,0)
 S PXKER=$P($T(@PXKNOD+PXKPCE),";;",2)
"RTN","PXKFIMM",39,0)
 Q
"RTN","PXKFIMM",40,0)
EN2 ;
"RTN","PXKFIMM",41,0)
 S PXKFD=""
"RTN","PXKFIMM",42,0)
 S PXKFD=$P($T(@PXKNOD+PXKPCE),";;",2) D
"RTN","PXKFIMM",43,0)
 .I PXKFD="" S PXKPCE=PXKPCE+1 D EN2
"RTN","PXKFIMM",44,0)
 Q
"RTN","PXKFIMM",45,0)
ADD ;Add an entry to the file
"RTN","PXKFIMM",46,0)
 ;Q
"RTN","PXKFIMM",47,0)
0 ;;1,2,3 * 0+1,0+3 * 1
"RTN","PXKFIMM",48,0)
 ;;.01////^S X=$G(
"RTN","PXKFIMM",49,0)
 ;;.02////^S X=$G(
"RTN","PXKFIMM",50,0)
 ;;.03////^S X=$G(
"RTN","PXKFIMM",51,0)
 ;;.04////^S X=$G(
"RTN","PXKFIMM",52,0)
 ;;
"RTN","PXKFIMM",53,0)
 ;;.06///^S X=$G(
"RTN","PXKFIMM",54,0)
 ;;.07///^S X=$G(
"RTN","PXKFIMM",55,0)
 ;;.08////^S X=$G(
"RTN","PXKFIMM",56,0)
 ;;.09////^S X=$G(
"RTN","PXKFIMM",57,0)
 ;;.1////^S X=$G(
"RTN","PXKFIMM",58,0)
 ;;.11////^S X=$G(
"RTN","PXKFIMM",59,0)
 ;;.12////^S X=$G(
"RTN","PXKFIMM",60,0)
 ;;.13////^S X=$G(
"RTN","PXKFIMM",61,0)
 ;;.14////^S X=$G(
"RTN","PXKFIMM",62,0)
 ;;.15////^S X=$G(
"RTN","PXKFIMM",63,0)
11 ;;
"RTN","PXKFIMM",64,0)
 ;;1101///^S X=$G(
"RTN","PXKFIMM",65,0)
12 ;;
"RTN","PXKFIMM",66,0)
 ;;1201///^S X=$G(
"RTN","PXKFIMM",67,0)
 ;;1202////^S X=$G(
"RTN","PXKFIMM",68,0)
 ;;
"RTN","PXKFIMM",69,0)
 ;;1204////^S X=$G(
"RTN","PXKFIMM",70,0)
 ;;1205////^S X=$G(
"RTN","PXKFIMM",71,0)
 ;;
"RTN","PXKFIMM",72,0)
 ;;1207////^S X=$G(
"RTN","PXKFIMM",73,0)
13 ;;
"RTN","PXKFIMM",74,0)
 ;;1301////^S X=$G(
"RTN","PXKFIMM",75,0)
 ;;1302////^S X=$G(
"RTN","PXKFIMM",76,0)
 ;;1303////^S X=$G(
"RTN","PXKFIMM",77,0)
 ;;1304////^S X=$G(
"RTN","PXKFIMM",78,0)
 ;;
"RTN","PXKFIMM",79,0)
 ;;
"RTN","PXKFIMM",80,0)
 ;;
"RTN","PXKFIMM",81,0)
 ;;
"RTN","PXKFIMM",82,0)
 ;;
"RTN","PXKFIMM",83,0)
 ;;
"RTN","PXKFIMM",84,0)
 ;;
"RTN","PXKFIMM",85,0)
 ;;1312////^S X=$G(
"RTN","PXKFIMM",86,0)
 ;;1313////^S X=$G(
"RTN","PXKFIMM",87,0)
14 ;;
"RTN","PXKFIMM",88,0)
 ;;1401////^S X=$G(
"RTN","PXKFIMM",89,0)
 ;;1402///^S X=$G(
"RTN","PXKFIMM",90,0)
 ;;1403///^S X=$G(
"RTN","PXKFIMM",91,0)
 ;;1404////^S X=$G(
"RTN","PXKFIMM",92,0)
 ;;1405///^S X=$G(
"RTN","PXKFIMM",93,0)
 ;;1406///^S X=$G(
"RTN","PXKFIMM",94,0)
15 ;;
"RTN","PXKFIMM",95,0)
 ;;1501///^S X=$G(
"RTN","PXKFIMM",96,0)
801 ;;
"RTN","PXKFIMM",97,0)
 ;;80101///^S X=1;
"RTN","PXKFIMM",98,0)
 ;;80102///^S X=$G(PXKAUDIT);
"RTN","PXKFIMM",99,0)
811 ;;
"RTN","PXKFIMM",100,0)
 ;;81101///^S X=$G(
"RTN","PXKFIMM",101,0)
812 ;;
"RTN","PXKFIMM",102,0)
 ;;81201///^S X=$G(
"RTN","PXKFIMM",103,0)
 ;;81202////^S X=$G(
"RTN","PXKFIMM",104,0)
 ;;81203////^S X=$G(
"RTN","PXKFIMM",105,0)
SPEC ;
"RTN","PXKFIMM",106,0)
 Q
"RTN","PXKFSK")
0^18^B3471699^B2490158
"RTN","PXKFSK",1,0)
PXKFSK ;ISL/JVS - Fields for V SKIN TEST file ;07/29/2015
"RTN","PXKFSK",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**22,124,210**;Aug 12, 1996;Build 11
"RTN","PXKFSK",3,0)
 ;  Adding or Editing of data in a particular field can be controlled
"RTN","PXKFSK",4,0)
 ;by adding a ~ as a delimiter and the letters A and/or E to the
"RTN","PXKFSK",5,0)
 ;end of the line of text which represents what could be added
"RTN","PXKFSK",6,0)
 ;to the DR string in a DIE call.
"RTN","PXKFSK",7,0)
 ; 1. If none or all three(~AE) of these characters are added then
"RTN","PXKFSK",8,0)
 ;    the data in this field can be either added or edited.
"RTN","PXKFSK",9,0)
 ; 2. If only the ~ is added then the data in this field can be
"RTN","PXKFSK",10,0)
 ;    neither added or edited.
"RTN","PXKFSK",11,0)
 ; 3. IF only the ~A is added then the data can only be added to
"RTN","PXKFSK",12,0)
 ;    the file for this field but not edited.
"RTN","PXKFSK",13,0)
 ; 4. If only the ~E is added the the data can only be edited in
"RTN","PXKFSK",14,0)
 ;    this file for this field. (not a likely possibility)
"RTN","PXKFSK",15,0)
 ;
"RTN","PXKFSK",16,0)
 ; The word option in front of the line of text below tells the 
"RTN","PXKFSK",17,0)
 ;software to determine,based on the data, the appropriateness
"RTN","PXKFSK",18,0)
 ;of using either a "///" or "////" stuff in a DIE call.
"RTN","PXKFSK",19,0)
 ;
"RTN","PXKFSK",20,0)
 ; The information on line tag 0 $P(,," * ",1) are the piece numbers
"RTN","PXKFSK",21,0)
 ;of the fields on the zero node that are required by the data
"RTN","PXKFSK",22,0)
 ;dictionary and are checked for to determine if enough data is present
"RTN","PXKFSK",23,0)
 ;to proceed without any errors. $P(,," * ",2) are the nodes and
"RTN","PXKFSK",24,0)
 ;piece numbers of the fields used to determine duplicates in the
"RTN","PXKFSK",25,0)
 ;file (node+piece (eg. 12+4)). $P(,," * ",3) is a flag use to
"RTN","PXKFSK",26,0)
 ;determine if duplicates are allowed in this visit file. 
"RTN","PXKFSK",27,0)
 ;If it is set to 0 then no duplicate checks will occur. If it is
"RTN","PXKFSK",28,0)
 ;set to 1 then the file will be checked for duplicates based on
"RTN","PXKFSK",29,0)
 ;the information in $P 2.
"RTN","PXKFSK",30,0)
 ;
"RTN","PXKFSK",31,0)
 ; The following is the file's global name.  Each global must have a
"RTN","PXKFSK",32,0)
 ;unique name and can not have any subscripts as part of the global root.
"RTN","PXKFSK",33,0)
GLOBAL ;;^AUPNVSK
"RTN","PXKFSK",34,0)
 ;
"RTN","PXKFSK",35,0)
EN1 ;
"RTN","PXKFSK",36,0)
 S PXKER=""
"RTN","PXKFSK",37,0)
 S PXKER=$P($T(@PXKNOD+PXKPCE),";;",2)
"RTN","PXKFSK",38,0)
 Q
"RTN","PXKFSK",39,0)
EN2 ;
"RTN","PXKFSK",40,0)
 S PXKFD=""
"RTN","PXKFSK",41,0)
 S PXKFD=$P($T(@PXKNOD+PXKPCE),";;",2) D
"RTN","PXKFSK",42,0)
 .I PXKFD="" S PXKPCE=PXKPCE+1 D EN2
"RTN","PXKFSK",43,0)
 Q
"RTN","PXKFSK",44,0)
ADD ;Add an entry to the file
"RTN","PXKFSK",45,0)
 Q
"RTN","PXKFSK",46,0)
0 ;;1,2,3 * 0+1,0+3 * 0
"RTN","PXKFSK",47,0)
 ;;.01///^S X=$G(
"RTN","PXKFSK",48,0)
 ;;.02////^S X=$G(
"RTN","PXKFSK",49,0)
 ;;.03////^S X=$G(
"RTN","PXKFSK",50,0)
 ;;.04///^S X=$G(
"RTN","PXKFSK",51,0)
 ;;.05////^S X=$G(
"RTN","PXKFSK",52,0)
 ;;.06////^S X=$G(
"RTN","PXKFSK",53,0)
 ;;.07////^S X=$G(
"RTN","PXKFSK",54,0)
12 ;;
"RTN","PXKFSK",55,0)
 ;;1201///^S X=$G(
"RTN","PXKFSK",56,0)
 ;;1202////^S X=$G(
"RTN","PXKFSK",57,0)
 ;;
"RTN","PXKFSK",58,0)
 ;;1204////^S X=$G(
"RTN","PXKFSK",59,0)
 ;;
"RTN","PXKFSK",60,0)
 ;;
"RTN","PXKFSK",61,0)
 ;;
"RTN","PXKFSK",62,0)
 ;;
"RTN","PXKFSK",63,0)
 ;;
"RTN","PXKFSK",64,0)
 ;;
"RTN","PXKFSK",65,0)
 ;;1211////^S X=$G(
"RTN","PXKFSK",66,0)
 ;;1212////^S X=$G(
"RTN","PXKFSK",67,0)
 ;;
"RTN","PXKFSK",68,0)
 ;;1214////^S X=$G(
"RTN","PXKFSK",69,0)
 ;;
"RTN","PXKFSK",70,0)
 ;;
"RTN","PXKFSK",71,0)
 ;;
"RTN","PXKFSK",72,0)
 ;;
"RTN","PXKFSK",73,0)
 ;;
"RTN","PXKFSK",74,0)
 ;;1220////^S X=$G(
"RTN","PXKFSK",75,0)
 ;;
"RTN","PXKFSK",76,0)
13 ;;
"RTN","PXKFSK",77,0)
 ;;1301///^S X=$G(
"RTN","PXKFSK",78,0)
 ;;
"RTN","PXKFSK",79,0)
80 ;;
"RTN","PXKFSK",80,0)
 ;;801////^S X=$G(
"RTN","PXKFSK",81,0)
 ;;802////^S X=$G(
"RTN","PXKFSK",82,0)
 ;;803////^S X=$G(
"RTN","PXKFSK",83,0)
 ;;804////^S X=$G(
"RTN","PXKFSK",84,0)
 ;;805////^S X=$G(
"RTN","PXKFSK",85,0)
 ;;806////^S X=$G(
"RTN","PXKFSK",86,0)
 ;;807////^S X=$G(
"RTN","PXKFSK",87,0)
 ;;808////^S X=$G(
"RTN","PXKFSK",88,0)
801 ;;
"RTN","PXKFSK",89,0)
 ;;80101///^S X=1;
"RTN","PXKFSK",90,0)
 ;;80102///^S X=$G(PXKAUDIT);
"RTN","PXKFSK",91,0)
811 ;;
"RTN","PXKFSK",92,0)
 ;;81101///^S X=$G(
"RTN","PXKFSK",93,0)
812 ;;
"RTN","PXKFSK",94,0)
 ;;81201///^S X=$G(
"RTN","PXKFSK",95,0)
 ;;81202////^S X=$G(
"RTN","PXKFSK",96,0)
 ;;81203////^S X=$G(
"RTN","PXKFSK",97,0)
SPEC ;
"RTN","PXKFSK",98,0)
 Q
"RTN","PXKIMM")
0^5^B39277541^n/a
"RTN","PXKIMM",1,0)
PXKIMM ;BP/LMT - Main Routine for filing immunization multiples ;04/16/15  08:22
"RTN","PXKIMM",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXKIMM",3,0)
 ;
"RTN","PXKIMM",4,0)
CLEAN(PXKNODE) ; Clean for IMM multiples. Check to see if PXKAV=PXKBV
"RTN","PXKIMM",5,0)
 ;
"RTN","PXKIMM",6,0)
 N PXKSAME
"RTN","PXKIMM",7,0)
 ;
"RTN","PXKIMM",8,0)
 I $D(PXKAV(PXKNODE)) D
"RTN","PXKIMM",9,0)
 . ;
"RTN","PXKIMM",10,0)
 . S PXKSAME=1
"RTN","PXKIMM",11,0)
 . ;
"RTN","PXKIMM",12,0)
 . I PXKNODE=11 S PXKSAME=$$CMPRWP("PXKBV("_PXKNODE_")","PXKAV("_PXKNODE_")")
"RTN","PXKIMM",13,0)
 . I PXKNODE'=11 S PXKSAME=$$CMPR(,"PXKBV("_PXKNODE_")","PXKAV("_PXKNODE_")")
"RTN","PXKIMM",14,0)
 . ;
"RTN","PXKIMM",15,0)
 . I PXKSAME K PXKAV(PXKNODE)
"RTN","PXKIMM",16,0)
 ;
"RTN","PXKIMM",17,0)
 Q
"RTN","PXKIMM",18,0)
 ;
"RTN","PXKIMM",19,0)
DIE ; File data for multiples
"RTN","PXKIMM",20,0)
 ;
"RTN","PXKIMM",21,0)
 N PXKSUB,PXKSUBFILE,PXKWP,PXKIENS,PXKFDA,PXKERR
"RTN","PXKIMM",22,0)
 ;
"RTN","PXKIMM",23,0)
 I $G(PXKAV(PXKNOD,0))="@" D PURGE(PXKNOD) Q
"RTN","PXKIMM",24,0)
 ;
"RTN","PXKIMM",25,0)
 S PXKIENS=PXKPIEN_","
"RTN","PXKIMM",26,0)
 ;
"RTN","PXKIMM",27,0)
 I PXKNOD?1(1"2",1"3") D
"RTN","PXKIMM",28,0)
 . ;
"RTN","PXKIMM",29,0)
 . S PXKSUBFILE=$S(PXKNOD=2:9000010.112,1:9000010.113)
"RTN","PXKIMM",30,0)
 . ;
"RTN","PXKIMM",31,0)
 . S PXKSUB=0
"RTN","PXKIMM",32,0)
 . F  S PXKSUB=$O(PXKAV(PXKNOD,PXKSUB)) Q:'PXKSUB  D
"RTN","PXKIMM",33,0)
 . . I $G(PXKAV(PXKNOD,PXKSUB,1))="" Q
"RTN","PXKIMM",34,0)
 . . S PXKFDA(1,PXKSUBFILE,"+"_PXKSUB_","_PXKIENS,.01)=PXKAV(PXKNOD,PXKSUB,1)
"RTN","PXKIMM",35,0)
 . . I PXKNOD=2,$G(PXKAV(PXKNOD,PXKSUB,2))'="" D
"RTN","PXKIMM",36,0)
 . . . S PXKFDA(1,PXKSUBFILE,"+"_PXKSUB_","_PXKIENS,.02)=PXKAV(PXKNOD,PXKSUB,2)
"RTN","PXKIMM",37,0)
 . ;
"RTN","PXKIMM",38,0)
 . I '$D(PXKFDA(1)) Q
"RTN","PXKIMM",39,0)
 . ;
"RTN","PXKIMM",40,0)
 . ; Purge previous data before filing updates
"RTN","PXKIMM",41,0)
 . I PXKFGED D PURGE(PXKNOD)
"RTN","PXKIMM",42,0)
 . ;
"RTN","PXKIMM",43,0)
 . D UPDATE^DIE("","PXKFDA(1)",,"PXKERR")
"RTN","PXKIMM",44,0)
 ;
"RTN","PXKIMM",45,0)
 I PXKNOD=11 D
"RTN","PXKIMM",46,0)
 . ;
"RTN","PXKIMM",47,0)
 . S PXKSUB=0
"RTN","PXKIMM",48,0)
 . F  S PXKSUB=$O(PXKAV(PXKNOD,PXKSUB)) Q:'PXKSUB  D
"RTN","PXKIMM",49,0)
 . . S PXKWP(PXKSUB)=$G(PXKAV(PXKNOD,PXKSUB,1))
"RTN","PXKIMM",50,0)
 . ;
"RTN","PXKIMM",51,0)
 . I '$D(PXKWP) Q
"RTN","PXKIMM",52,0)
 . ;
"RTN","PXKIMM",53,0)
 . I PXKFGED D PURGE(PXKNOD)
"RTN","PXKIMM",54,0)
 . ;
"RTN","PXKIMM",55,0)
 . L +@PXKLR:10
"RTN","PXKIMM",56,0)
 . D WP^DIE(9000010.11,PXKIENS,1101,"","PXKWP","PXKERR")
"RTN","PXKIMM",57,0)
 . L -@PXKLR
"RTN","PXKIMM",58,0)
 ;
"RTN","PXKIMM",59,0)
 Q
"RTN","PXKIMM",60,0)
 ;
"RTN","PXKIMM",61,0)
PURGE(PXKNODE) ; Before filing edits for an entry, purge multiples
"RTN","PXKIMM",62,0)
 ;
"RTN","PXKIMM",63,0)
 I '$G(PXKPIEN) Q
"RTN","PXKIMM",64,0)
 ;
"RTN","PXKIMM",65,0)
 L +@PXKLR:10
"RTN","PXKIMM",66,0)
 ;
"RTN","PXKIMM",67,0)
 ; Delete data in REMARKS Word-processing field
"RTN","PXKIMM",68,0)
 I PXKNODE=11 D  Q
"RTN","PXKIMM",69,0)
 . D WP^DIE("9000010.11",PXKPIEN_",","1101",,"@")
"RTN","PXKIMM",70,0)
 ;
"RTN","PXKIMM",71,0)
 ; Delete data in VIS and OTHER DIAGNOSIS multiple
"RTN","PXKIMM",72,0)
 I PXKNODE?1(1"2",1"3") D
"RTN","PXKIMM",73,0)
 . N DIK,DA
"RTN","PXKIMM",74,0)
 . S DA(1)=PXKPIEN
"RTN","PXKIMM",75,0)
 . S DIK="^AUPNVIMM("_DA(1)_","_PXKNODE_","
"RTN","PXKIMM",76,0)
 . S DA=0 F  S DA=$O(^AUPNVIMM(DA(1),PXKNODE,DA)) Q:'DA  D ^DIK
"RTN","PXKIMM",77,0)
 ;
"RTN","PXKIMM",78,0)
 L -@PXKLR
"RTN","PXKIMM",79,0)
 ;
"RTN","PXKIMM",80,0)
 Q
"RTN","PXKIMM",81,0)
 ;
"RTN","PXKIMM",82,0)
CMPRWP(PXKLIST1,PXKLIST2) ; Compares two word-processing arrays for equivalence.
"RTN","PXKIMM",83,0)
 ;
"RTN","PXKIMM",84,0)
 N PXKSAME,PXKCOUNT1,PXKCOUNT2,PXKSUBIEN1,PXKSUBIEN2,PXKX1,PXKX2
"RTN","PXKIMM",85,0)
 ;
"RTN","PXKIMM",86,0)
 S PXKSAME=1 ; flag if before and after arrays are equivalent
"RTN","PXKIMM",87,0)
 ;
"RTN","PXKIMM",88,0)
 ; check # entries
"RTN","PXKIMM",89,0)
 S PXKCOUNT1=0
"RTN","PXKIMM",90,0)
 S PXKCOUNT2=0
"RTN","PXKIMM",91,0)
 S PXKSUBIEN1=0
"RTN","PXKIMM",92,0)
 F  S PXKSUBIEN1=$O(@PXKLIST1@(PXKSUBIEN1)) Q:'PXKSUBIEN1  D
"RTN","PXKIMM",93,0)
 . I $D(@PXKLIST1@(PXKSUBIEN1,0))!($D(@PXKLIST1@(PXKSUBIEN1,1))) S PXKCOUNT1=PXKCOUNT1+1
"RTN","PXKIMM",94,0)
 S PXKSUBIEN2=0
"RTN","PXKIMM",95,0)
 F  S PXKSUBIEN2=$O(@PXKLIST2@(PXKSUBIEN2)) Q:'PXKSUBIEN2  D
"RTN","PXKIMM",96,0)
 . I $D(@PXKLIST2@(PXKSUBIEN2,0))!($D(@PXKLIST2@(PXKSUBIEN2,1))) S PXKCOUNT2=PXKCOUNT2+1
"RTN","PXKIMM",97,0)
 I PXKCOUNT1'=PXKCOUNT2 S PXKSAME=0 Q PXKSAME
"RTN","PXKIMM",98,0)
 ;
"RTN","PXKIMM",99,0)
 ; Check word-processind field. Order and content need to match
"RTN","PXKIMM",100,0)
 S PXKSUBIEN1=0
"RTN","PXKIMM",101,0)
 S PXKSUBIEN2=0
"RTN","PXKIMM",102,0)
 F  S PXKSUBIEN1=$O(@PXKLIST1@(PXKSUBIEN1)) Q:'PXKSUBIEN1  D
"RTN","PXKIMM",103,0)
 . S PXKSUBIEN2=$O(@PXKLIST2@(PXKSUBIEN2))
"RTN","PXKIMM",104,0)
 . S PXKX1=$S($G(@PXKLIST1@(PXKSUBIEN1,0))'="":$G(@PXKLIST1@(PXKSUBIEN1,0)),1:$G(@PXKLIST1@(PXKSUBIEN1,1)))
"RTN","PXKIMM",105,0)
 . S PXKX2=$S($G(@PXKLIST2@(PXKSUBIEN2,0))'="":$G(@PXKLIST2@(PXKSUBIEN2,0)),1:$G(@PXKLIST2@(PXKSUBIEN2,1)))
"RTN","PXKIMM",106,0)
 . I PXKX1'=PXKX2 S PXKSAME=0
"RTN","PXKIMM",107,0)
 ;
"RTN","PXKIMM",108,0)
 Q PXKSAME
"RTN","PXKIMM",109,0)
 ;
"RTN","PXKIMM",110,0)
CMPR(PXKDIFF,PXKLIST1,PXKLIST2) ;
"RTN","PXKIMM",111,0)
 ;
"RTN","PXKIMM",112,0)
 ; Compares two arrays for equivalence.
"RTN","PXKIMM",113,0)
 ; Returns any data that was in PXKLIST1 that was not in PXKLIST2 in PXKDIFF
"RTN","PXKIMM",114,0)
 ;
"RTN","PXKIMM",115,0)
 ; PXKLIST1 is in same format as PXKAV and PXKBV arrays
"RTN","PXKIMM",116,0)
 ; PXKLIST2 can be in the format of PXKAV/PXKBV arrays or can be in global format.
"RTN","PXKIMM",117,0)
 ;
"RTN","PXKIMM",118,0)
 N PXKMATCH,PXKSAME,PXKSUBIEN,PXKVAL,PXKVAL1,PXKTMPBV,PXKSUBIENB
"RTN","PXKIMM",119,0)
 ;
"RTN","PXKIMM",120,0)
 S PXKSAME=1 ; flag if before and after arrays are equivalent
"RTN","PXKIMM",121,0)
 ;
"RTN","PXKIMM",122,0)
 ; Check multiple to see if before and after arrays match. Content needs to match, but order doesn't matter
"RTN","PXKIMM",123,0)
 S PXKSUBIEN=0
"RTN","PXKIMM",124,0)
 F  S PXKSUBIEN=$O(@PXKLIST1@(PXKSUBIEN)) Q:'PXKSUBIEN  D
"RTN","PXKIMM",125,0)
 . S PXKVAL=$$CONCAT($NA(@PXKLIST1@(PXKSUBIEN)))  ; returns array as caret ('^') delimited string
"RTN","PXKIMM",126,0)
 . S PXKVAL1=$P(PXKVAL,U,1)
"RTN","PXKIMM",127,0)
 . I PXKVAL1="" S PXKVAL1=" "
"RTN","PXKIMM",128,0)
 . S PXKTMPBV(PXKVAL1,PXKSUBIEN)=PXKVAL
"RTN","PXKIMM",129,0)
 S PXKSUBIEN=0
"RTN","PXKIMM",130,0)
 F  S PXKSUBIEN=$O(@PXKLIST2@(PXKSUBIEN)) Q:'PXKSUBIEN  D
"RTN","PXKIMM",131,0)
 . S PXKVAL=$S(PXKLIST2["^":$G(@PXKLIST2@(PXKSUBIEN,0)),1:$$CONCAT($NA(@PXKLIST2@(PXKSUBIEN))))
"RTN","PXKIMM",132,0)
 . S PXKVAL1=$P(PXKVAL,U,1)
"RTN","PXKIMM",133,0)
 . I PXKVAL1="" S PXKVAL1=" "
"RTN","PXKIMM",134,0)
 . S PXKSUBIENB=0
"RTN","PXKIMM",135,0)
 . S PXKMATCH=0
"RTN","PXKIMM",136,0)
 . F  S PXKSUBIENB=$O(PXKTMPBV(PXKVAL1,PXKSUBIENB)) Q:'PXKSUBIENB!(PXKMATCH)  D
"RTN","PXKIMM",137,0)
 . . I PXKVAL=$G(PXKTMPBV(PXKVAL1,PXKSUBIENB)) D
"RTN","PXKIMM",138,0)
 . . . S PXKMATCH=1
"RTN","PXKIMM",139,0)
 . . . K PXKTMPBV(PXKVAL1,PXKSUBIENB)
"RTN","PXKIMM",140,0)
 . I 'PXKMATCH S PXKSAME=0
"RTN","PXKIMM",141,0)
 ;
"RTN","PXKIMM",142,0)
 I $D(PXKTMPBV) D
"RTN","PXKIMM",143,0)
 . S PXKSAME=0
"RTN","PXKIMM",144,0)
 . S PXKVAL1="" F  S PXKVAL1=$O(PXKTMPBV(PXKVAL1)) Q:PXKVAL1=""  D
"RTN","PXKIMM",145,0)
 . . S PXKSUBIEN=0 F  S PXKSUBIEN=$O(PXKTMPBV(PXKVAL1,PXKSUBIEN)) Q:'PXKSUBIEN  D
"RTN","PXKIMM",146,0)
 . . . S PXKDIFF(PXKSUBIEN)=$G(PXKTMPBV(PXKVAL1,PXKSUBIEN))
"RTN","PXKIMM",147,0)
 ;
"RTN","PXKIMM",148,0)
 Q PXKSAME
"RTN","PXKIMM",149,0)
 ;
"RTN","PXKIMM",150,0)
CONCAT(PXKLIST) ; Concatenates array into a caret ('^') delimited string
"RTN","PXKIMM",151,0)
 ;
"RTN","PXKIMM",152,0)
 N PXKI,PXKRESULT
"RTN","PXKIMM",153,0)
 ;
"RTN","PXKIMM",154,0)
 S PXKRESULT=""
"RTN","PXKIMM",155,0)
 ;
"RTN","PXKIMM",156,0)
 S PXKI=0
"RTN","PXKIMM",157,0)
 F  S PXKI=$O(@PXKLIST@(PXKI)) Q:'PXKI  D
"RTN","PXKIMM",158,0)
 . S $P(PXKRESULT,U,PXKI)=$G(@PXKLIST@(PXKI))
"RTN","PXKIMM",159,0)
 ;
"RTN","PXKIMM",160,0)
 Q PXKRESULT
"RTN","PXKIMM",161,0)
 ;
"RTN","PXKIMM",162,0)
ER ; Check if data was filed ok
"RTN","PXKIMM",163,0)
 ;
"RTN","PXKIMM",164,0)
 N PXKSAME,PXKDIFF,PXKFLD,PXKNODE,PXKSUB,PXKSTR
"RTN","PXKIMM",165,0)
 ;
"RTN","PXKIMM",166,0)
 ; Check VIS and OTHER DIAGNOSIS multiple
"RTN","PXKIMM",167,0)
 F PXKNODE=2,3 D
"RTN","PXKIMM",168,0)
 . K PXKDIFF
"RTN","PXKIMM",169,0)
 . S PXKSAME=$$CMPR(.PXKDIFF,"PXKAV("_PXKNODE_")","^AUPNVIMM("_DA_","_PXKNODE_")")
"RTN","PXKIMM",170,0)
 . I 'PXKSAME,$D(PXKDIFF) D
"RTN","PXKIMM",171,0)
 . . S PXKSUB=0 F  S PXKSUB=$O(PXKDIFF(PXKSUB)) Q:'PXKSUB  D
"RTN","PXKIMM",172,0)
 . . . S PXKSTR="Not Stored = "_$G(PXKDIFF(PXKSUB))
"RTN","PXKIMM",173,0)
 . . . I $G(PXKERROR(PXKCAT,PXKSEQ,DA,PXKNODE,PXKSUB))'="" D
"RTN","PXKIMM",174,0)
 . . . .  S PXKSTR=PXKERROR(PXKCAT,PXKSEQ,DA,PXKNODE,PXKSUB)_","_$G(PXKDIFF(PXKSUB))
"RTN","PXKIMM",175,0)
 . . . S PXKERROR(PXKCAT,PXKSEQ,DA,PXKNODE,PXKSUB)=PXKSTR
"RTN","PXKIMM",176,0)
 ;
"RTN","PXKIMM",177,0)
 ; Check REMARKS word-processing fields
"RTN","PXKIMM",178,0)
 S PXKSAME=$$CMPRWP("PXKAV(11)","^AUPNVIMM("_DA_",11)")
"RTN","PXKIMM",179,0)
 I 'PXKSAME D
"RTN","PXKIMM",180,0)
 . S PXKFLD=1101
"RTN","PXKIMM",181,0)
 . S PXKSTR="Not Stored = REMARKS Word-processing"
"RTN","PXKIMM",182,0)
 . I $G(PXKERROR(PXKCAT,PXKSEQ,DA,PXKFLD))]"" D
"RTN","PXKIMM",183,0)
 . .  S PXKSTR=PXKERROR(PXKCAT,PXKSEQ,DA,PXKFLD)_",REMARKS Word-processing"
"RTN","PXKIMM",184,0)
 . S PXKERROR(PXKCAT,PXKSEQ,DA,PXKFLD)=PXKSTR
"RTN","PXKIMM",185,0)
 ;
"RTN","PXKIMM",186,0)
 Q
"RTN","PXKMAIN")
0^6^B55417967^B43120971
"RTN","PXKMAIN",1,0)
PXKMAIN ;ISL/JVS,ISA/Zoltan - Main Routine for Data Capture ;04/15/15  10:10
"RTN","PXKMAIN",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**22,59,73,88,69,117,130,124,174,164,210**;Aug 12, 1996;Build 11
"RTN","PXKMAIN",3,0)
 ;+This routine is responsible for:
"RTN","PXKMAIN",4,0)
 ;+
"RTN","PXKMAIN",5,0)
 ;+LOCAL VARIABLE LIST:
"RTN","PXKMAIN",6,0)
 ;+ PXP59LOC = LOCK name (introduced in patch PX*1.0*59).
"RTN","PXKMAIN",7,0)
 ;+ PXFG     = Stop flag with duplicate of delete
"RTN","PXKMAIN",8,0)
 ;+ PXKAFT   = After node
"RTN","PXKMAIN",9,0)
 ;+ PXKBEF   = Before node
"RTN","PXKMAIN",10,0)
 ;+ PXKAV    = Pieces from the after node
"RTN","PXKMAIN",11,0)
 ;+ PXKBV    = Pieces from the before node
"RTN","PXKMAIN",12,0)
 ;+ PXKERROR = Set when there is an error
"RTN","PXKMAIN",13,0)
 ;+ PXKFGAD  = ADD flag
"RTN","PXKMAIN",14,0)
 ;+ PXKFGED  = EDIT flag
"RTN","PXKMAIN",15,0)
 ;+ PXKFGDE  = DELETE flag
"RTN","PXKMAIN",16,0)
 ;+ PXKSEQ   = Sequence number in PXK tmp global
"RTN","PXKMAIN",17,0)
 ;+ PXKCAT   = Category of entry (CPT,MSR,VST...)
"RTN","PXKMAIN",18,0)
 ;+ PXKREF   = Root of temp global
"RTN","PXKMAIN",19,0)
 ;+ PXKPIEN  = IEN of v file or the visit file
"RTN","PXKMAIN",20,0)
 ;+ PXKREF   = The original reference we are ordering off of
"RTN","PXKMAIN",21,0)
 ;+ PXKRT    = name of the node in the v file
"RTN","PXKMAIN",22,0)
 ;+ PXKRTN   = routine name for the file routine
"RTN","PXKMAIN",23,0)
 ;+ PXKSOR   = the data source for this entry
"RTN","PXKMAIN",24,0)
 ;+ PXKSUB   = the subscript the data is located on the v file
"RTN","PXKMAIN",25,0)
 ;+ PXKVST   = the visit IEN
"RTN","PXKMAIN",26,0)
 ;+ PXKDUZ   = the DUZ of the user
"RTN","PXKMAIN",27,0)
 ;+ *PXKHLR* = A variable set by calling routine so that duplicate
"RTN","PXKMAIN",28,0)
 ;+            PXKERROR messages aren't produced.
"RTN","PXKMAIN",29,0)
 ;
"RTN","PXKMAIN",30,0)
 W !,"This is not an entry point" Q
"RTN","PXKMAIN",31,0)
EN1 ;+Main entry point to read ^TMP("PXK", Global
"RTN","PXKMAIN",32,0)
 ;+ Partial ^TMP Global Structure when called:
"RTN","PXKMAIN",33,0)
 ;+ ^TMP("PXK",$J,"SOR") = Source ien
"RTN","PXKMAIN",34,0)
 ;+
"RTN","PXKMAIN",35,0)
 ;+ ^TMP("PXK",$J,"VST",1,0,"BEFORE") = the 0-node of the visit file
"RTN","PXKMAIN",36,0)
 ;+ ^TMP("PXK",$J,"VST",1,0,"AFTER") = 0-node after changes.
"RTN","PXKMAIN",37,0)
 ;+ ^TMP("PXK",$J,"VST",provider counter,"IEN") = ""
"RTN","PXKMAIN",38,0)
 ;+
"RTN","PXKMAIN",39,0)
 ;+ ^TMP("PXK",$J,"PRV",provider counter,0,"BEFORE") = ""
"RTN","PXKMAIN",40,0)
 ;+ ^TMP("PXK",$J,"PRV",provider counter,0,"AFTER") = Provider id^DFN^Visitien^'P' or 'S' for primary/secondary
"RTN","PXKMAIN",41,0)
 ;+ ^TMP("PXK",$J,"PRV",provider counter,"IEN") = ""
"RTN","PXKMAIN",42,0)
 ;+ ^TMP("PXK",$J,"PRV",provider counter,"BEFORE") = ""
"RTN","PXKMAIN",43,0)
 ;+ ^TMP("PXK",$J,"PRV",provider counter,"AFTER") = ^Package ien^Source ien
"RTN","PXKMAIN",44,0)
 ;+
"RTN","PXKMAIN",45,0)
 N PXP59LOC
"RTN","PXKMAIN",46,0)
 D LOCK
"RTN","PXKMAIN",47,0)
 K PXKERROR
"RTN","PXKMAIN",48,0)
 I '$G(PXKDUZ) D
"RTN","PXKMAIN",49,0)
 . I $G(DUZ) S PXKDUZ=DUZ
"RTN","PXKMAIN",50,0)
 . E  S PXKDUZ=.5
"RTN","PXKMAIN",51,0)
 D VST
"RTN","PXKMAIN",52,0)
 I $D(PXP59LOC) D UNLOCK
"RTN","PXKMAIN",53,0)
 Q
"RTN","PXKMAIN",54,0)
VST ;--Check for visit node and get one created or quit.
"RTN","PXKMAIN",55,0)
 I '$G(^TMP("PXK",$J,"VST",1,"IEN")) D
"RTN","PXKMAIN",56,0)
 .D VSIT^PXKVST
"RTN","PXKMAIN",57,0)
 I +$G(^TMP("PXK",$J,"VST",1,"IEN"))=-1 S PXKERROR("VISIT")="Visit Tracking could not get a visit." Q
"RTN","PXKMAIN",58,0)
 I +$G(^TMP("PXK",$J,"VST",1,"IEN"))=-2 S PXKERROR("VISIT")="PCE is not activated in Visit Tracking Parameters and thus cannot create visits." Q
"RTN","PXKMAIN",59,0)
 I +$G(^TMP("PXK",$J,"VST",1,"IEN"))<1 S PXKERROR("VISIT")="Did not get a visit^"_$G(^TMP("PXK",$J,"VST",1,"IEN")) Q
"RTN","PXKMAIN",60,0)
 ;
"RTN","PXKMAIN",61,0)
NEW ;--New variables and set main variables
"RTN","PXKMAIN",62,0)
 N PXKDFN,PXKSOR,PXKVST,PXKSEQ,PXFG,PXKAFT,PXKBEF,PXKAUDIT
"RTN","PXKMAIN",63,0)
 N PXKCAT,PXKER,PXKFGAD,PXKFGED,PXKFGDE,PXKNOD,PXKPCE
"RTN","PXKMAIN",64,0)
 N PXKPIEN,PXKREF,PXKRTN,PXKSORR,PXKSUB,PXKVCAT
"RTN","PXKMAIN",65,0)
 N PXKPTR,PXDFG,PX,PXJJJ,PXKAFT8,PXKAFTR,PXKGN,PXKN,PXKP
"RTN","PXKMAIN",66,0)
 N PXKRRT,PXKVRTN,PXKRT,PXKFVDLM,TMPPX
"RTN","PXKMAIN",67,0)
PRVTYPE ;---DO PROVIDER TYPE--PXKMAIN2
"RTN","PXKMAIN",68,0)
 D PRVTYPE^PXKMAIN2
"RTN","PXKMAIN",69,0)
 ;
"RTN","PXKMAIN",70,0)
SET ;--SET VARIABLES NECESSARY
"RTN","PXKMAIN",71,0)
 ;'DA' should not be defined at this point
"RTN","PXKMAIN",72,0)
 N DA ;PX*1.0*117
"RTN","PXKMAIN",73,0)
 ;
"RTN","PXKMAIN",74,0)
 S PXFG=0,TMPPX="^",PXKLAYGO="",PXDFG=0
"RTN","PXKMAIN",75,0)
SOURCE S PXKSOR=$G(^TMP("PXK",$J,"SOR")) D  Q:$D(PXKERROR("SOURCE"))
"RTN","PXKMAIN",76,0)
 .S PXKCO("SOR")=PXKSOR
"RTN","PXKMAIN",77,0)
 .I $D(PXKSOR)']"" S PXKERROR("SOURCE")="" Q
"RTN","PXKMAIN",78,0)
VISIT S (PXKVST,VSIT("IEN"))=$G(^TMP("PXK",$J,"VST",1,"IEN"))
"RTN","PXKMAIN",79,0)
ORDER ;--$ORDER Through the ^TMP("PXK", global setting variables
"RTN","PXKMAIN",80,0)
 S PXKREF="^TMP(""PXK"",$J)"
"RTN","PXKMAIN",81,0)
CATEG S PXKCAT="" F  S (PXKCAT,PXKVCAT)=$O(@PXKREF@(PXKCAT)) Q:PXKCAT=""  D
"RTN","PXKMAIN",82,0)
 .I PXKCAT="VST" S PXKVCAT="SIT"
"RTN","PXKMAIN",83,0)
 .S PXKRTN="PXKF"_PXKCAT
"RTN","PXKMAIN",84,0)
 .S X=PXKRTN X ^%ZOSF("TEST") Q:'$T
"RTN","PXKMAIN",85,0)
SEQUE .S PXKSEQ=0 F  S PXKSEQ=$O(@PXKREF@(PXKCAT,PXKSEQ)) K PXKAV,PXKBV S PXFG=0 Q:'PXKSEQ  D
"RTN","PXKMAIN",86,0)
 ..S PXKPIEN=$G(@PXKREF@(PXKCAT,PXKSEQ,"IEN")),(PXKFGAD,PXKFGDE,PXKFGED,PXDFG)=0
"RTN","PXKMAIN",87,0)
SUBSCR ..S PXKSUB="" F  S PXKSUB=$O(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB)) Q:PXKSUB["IEN"  Q:PXFG=1  Q:PXDFG=1  D
"RTN","PXKMAIN",88,0)
AFTER ...S PXKAFT(PXKSUB)=$G(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,"AFTER"))
"RTN","PXKMAIN",89,0)
BEFORE ...S PXKBEF(PXKSUB)=$G(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,"BEFORE"))
"RTN","PXKMAIN",90,0)
 ...I PXKCAT="CPT",PXKSUB=1 D SUBSCR^PXKMOD
"RTN","PXKMAIN",91,0)
 ...I PXKCAT="IMM",PXKSUB?1(1"2",1"3",1"11") D MULT
"RTN","PXKMAIN",92,0)
 ...D LOOP^PXKMAIN1 D ERROR^PXKMAIN1 S PXDFG=0 I $G(PXKAV(0,1))["@"!('$D(PXKAV(0,1))) S PXKAFT(PXKSUB)="" K PXKAV(0) S PXDFG=1
"RTN","PXKMAIN",93,0)
 ..Q:PXFG=1
"RTN","PXKMAIN",94,0)
 ..I $D(PXKAV),'$D(PXKBV) S PXKSORR=PXKSOR_"-A "_PXKDUZ,PXKFGAD=1 I PXKCAT["VST" S PXKFGAD=0
"RTN","PXKMAIN",95,0)
 ..I '$D(PXKAV),$D(PXKBV) S PXKFGDE=1,PXKFVDLM="" D
"RTN","PXKMAIN",96,0)
 ...S PXKRT=$P($T(GLOBAL^@PXKRTN),";;",2)_"("_PXKPIEN_")" I $D(@PXKRT) D DELETE^PXKMAIN1,EN1^PXKMASC S PXFG=1 K PXKRT Q
"RTN","PXKMAIN",97,0)
 ..I 'PXKFGAD,'PXKFGDE D
"RTN","PXKMAIN",98,0)
 ...I PXKCAT="VST" D CQDEL
"RTN","PXKMAIN",99,0)
 ...D CLEAN^PXKMAIN1
"RTN","PXKMAIN",100,0)
 ...I $D(PXKAV) S PXKSORR=PXKSOR_"-E "_PXKDUZ,PXKFGED=1 I PXKCAT="VST",'$D(PXKBV),$D(PXKVST) S PXKFGED=0
"RTN","PXKMAIN",101,0)
 ..I 'PXKFGAD,'PXKFGDE,'PXKFGED,PXKCAT["VST" D EN1^PXKMASC
"RTN","PXKMAIN",102,0)
 ..I PXKFGAD=1 D  Q:PXFG
"RTN","PXKMAIN",103,0)
 ...D ERROR^PXKMAIN1
"RTN","PXKMAIN",104,0)
 ...I $D(PXKERROR(PXKCAT,PXKSEQ)) S PXFG=1
"RTN","PXKMAIN",105,0)
 ...D:'PXFG DUP^PXKMAIN1
"RTN","PXKMAIN",106,0)
 ...I PXFG=1 D  Q
"RTN","PXKMAIN",107,0)
 ....Q:PXKCAT'="CPT"
"RTN","PXKMAIN",108,0)
 ....I $G(@PXKREF@(PXKCAT,PXKSEQ,"IEN"))]"" D REMOVE^PXCEVFIL(@PXKREF@(PXKCAT,PXKSEQ,"IEN"))
"RTN","PXKMAIN",109,0)
 ...D:'PXKPIEN FILE^PXKMAIN1
"RTN","PXKMAIN",110,0)
 ...S:'$G(DA) DA=PXKPIEN
"RTN","PXKMAIN",111,0)
 ...D AUD2^PXKMAIN1,DRDIE^PXKMAIN1,EN1^PXKMASC
"RTN","PXKMAIN",112,0)
 ..I PXKFGED=1,PXKCAT'="VST" S PXKRT=$P($T(GLOBAL^@PXKRTN),";;",2)_"("_PXKPIEN_")" Q:'$D(@PXKRT)  S DA=PXKPIEN D DUP^PXKMAIN1 Q:PXFG=1  D AUD12^PXKMAIN1,DRDIE^PXKMAIN1,EN1^PXKMASC
"RTN","PXKMAIN",113,0)
 ..I PXKFGED=1,PXKCAT="VST" S PXKRT=$P($T(GLOBAL^@PXKRTN),";;",2)_"("_PXKPIEN_")" Q:'$D(@PXKRT)  S DA=PXKPIEN D DUP^PXKMAIN1 Q:PXFG=1  D DRDIE^PXKMAIN1,EN1^PXKMASC
"RTN","PXKMAIN",114,0)
 ..D SPEC^PXKMAIN2
"RTN","PXKMAIN",115,0)
 ..K PXKAFT,PXKBEF
"RTN","PXKMAIN",116,0)
 I $D(^TMP("PXKSAVE",$J)) D RECALL^PXKMAIN2
"RTN","PXKMAIN",117,0)
 D EXIT
"RTN","PXKMAIN",118,0)
 Q
"RTN","PXKMAIN",119,0)
 ;
"RTN","PXKMAIN",120,0)
MULT ; Add multiples to PXKAFT, PXKBEF, PXKAV, PXKBV arrays
"RTN","PXKMAIN",121,0)
 ;
"RTN","PXKMAIN",122,0)
 N PXKSUBIEN,PXKI
"RTN","PXKMAIN",123,0)
 ;
"RTN","PXKMAIN",124,0)
 S PXKSUBIEN=0
"RTN","PXKMAIN",125,0)
 F  S PXKSUBIEN=$O(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,PXKSUBIEN)) Q:'PXKSUBIEN  D
"RTN","PXKMAIN",126,0)
 . ;
"RTN","PXKMAIN",127,0)
 . I $D(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,PXKSUBIEN,"AFTER")) D
"RTN","PXKMAIN",128,0)
 . . S PXKAFT(PXKSUB,PXKSUBIEN)=$G(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,PXKSUBIEN,"AFTER"))
"RTN","PXKMAIN",129,0)
 . . F PXKI=1:1:$L(PXKAFT(PXKSUB,PXKSUBIEN),"^") D
"RTN","PXKMAIN",130,0)
 . . . I $P(PXKAFT(PXKSUB,PXKSUBIEN),"^",PXKI)'="" S PXKAV(PXKSUB,PXKSUBIEN,PXKI)=$P(PXKAFT(PXKSUB,PXKSUBIEN),"^",PXKI)
"RTN","PXKMAIN",131,0)
 . ;
"RTN","PXKMAIN",132,0)
 . I $D(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,PXKSUBIEN,"BEFORE")) D
"RTN","PXKMAIN",133,0)
 . . S PXKBEF(PXKSUB,PXKSUBIEN)=$G(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,PXKSUBIEN,"BEFORE"))
"RTN","PXKMAIN",134,0)
 . . F PXKI=1:1:$L(PXKBEF(PXKSUB,PXKSUBIEN),"^") D
"RTN","PXKMAIN",135,0)
 . . . I $P(PXKBEF(PXKSUB,PXKSUBIEN),"^",PXKI)'="" S PXKBV(PXKSUB,PXKSUBIEN,PXKI)=$P(PXKBEF(PXKSUB,PXKSUBIEN),"^",PXKI)
"RTN","PXKMAIN",136,0)
 ;
"RTN","PXKMAIN",137,0)
 I $G(@PXKREF@(PXKCAT,PXKSEQ,PXKSUB,0,"AFTER"))="@" D
"RTN","PXKMAIN",138,0)
 . S PXKAFT(PXKSUB,0)="@"
"RTN","PXKMAIN",139,0)
 . S PXKAV(PXKSUB,0)="@"
"RTN","PXKMAIN",140,0)
 ;
"RTN","PXKMAIN",141,0)
 Q
"RTN","PXKMAIN",142,0)
 ;
"RTN","PXKMAIN",143,0)
EXIT ;--EXIT
"RTN","PXKMAIN",144,0)
 I $D(PXKFVDLM) D MODIFIED^VSIT(PXKVST)
"RTN","PXKMAIN",145,0)
 K PXKPXD,TMPPX
"RTN","PXKMAIN",146,0)
 K DA,DR,PXKI,PXKJ,PXKLAYGO,PXKDUZ,PXKAFT8,PXKAFTR,VSIT("IEN") Q
"RTN","PXKMAIN",147,0)
EVENT ;--ENTRY POINT TO POST EXECUTE PCE'S EVENT
"RTN","PXKMAIN",148,0)
 ;Setting the variable PXKNOEVT=1 will stop the event from being
"RTN","PXKMAIN",149,0)
 ;fired off whenever any data is sent into PCE
"RTN","PXKMAIN",150,0)
 ;
"RTN","PXKMAIN",151,0)
 ;PX*1*124  AUTO-POPULATE THE ENCOUNTER SC/EI BASED ON THE ENCOUNTER DX'S
"RTN","PXKMAIN",152,0)
 ;PX*1.0*164 Relocate the PXCECCLS call
"RTN","PXKMAIN",153,0)
 I $D(^TMP("PXKCO",$J)) D
"RTN","PXKMAIN",154,0)
 . S PXKVVST=+$O(^TMP("PXKCO",$J,0))
"RTN","PXKMAIN",155,0)
 . I $G(PXKVVST) D VST^PXCECCLS(PXKVVST) ;PX*1.0*174
"RTN","PXKMAIN",156,0)
 ;
"RTN","PXKMAIN",157,0)
 I $G(PXKNOEVT) K ^TMP("PXKCO",$J) Q
"RTN","PXKMAIN",158,0)
 N PXP59LOC
"RTN","PXKMAIN",159,0)
 D LOCK
"RTN","PXKMAIN",160,0)
 D EVENT^PXKMASC
"RTN","PXKMAIN",161,0)
 I $D(PXP59LOC) D UNLOCK
"RTN","PXKMAIN",162,0)
 Q
"RTN","PXKMAIN",163,0)
LOCK ; Lock (results in PXP59LOC)--Patch PX*1.0*59.
"RTN","PXKMAIN",164,0)
 N PX0,PXWHO,PXWHERE,PXWHEN,PXEXIT,PXVISIT
"RTN","PXKMAIN",165,0)
 S PXEXIT=1,(PXWHO,PXWHERE,PXWHEN)=""
"RTN","PXKMAIN",166,0)
 ;First case: new visit data being saved.
"RTN","PXKMAIN",167,0)
 I 11[$D(^TMP("PXK",$J,"VST",1,0,"AFTER")) D
"RTN","PXKMAIN",168,0)
 . S PX0=^TMP("PXK",$J,"VST",1,0,"AFTER")
"RTN","PXKMAIN",169,0)
 . D L2
"RTN","PXKMAIN",170,0)
 ;Second case: use existing visit data.
"RTN","PXKMAIN",171,0)
 I 11[$D(^TMP("PXK",$J,"VST",1,"IEN")) D
"RTN","PXKMAIN",172,0)
 . S PXVISIT=+^TMP("PXK",$J,"VST",1,"IEN")
"RTN","PXKMAIN",173,0)
 . Q:'PXVISIT
"RTN","PXKMAIN",174,0)
 . Q:$D(^AUPNVSIT(PXVISIT,0))[0
"RTN","PXKMAIN",175,0)
 . S PX0=^AUPNVSIT(PXVISIT,0)
"RTN","PXKMAIN",176,0)
 . D L2
"RTN","PXKMAIN",177,0)
 ;Third case: Uses "PXKCO" instead of "PXK".
"RTN","PXKMAIN",178,0)
 I PXEXIT,$D(^TMP("PXKCO",$J)) D
"RTN","PXKMAIN",179,0)
 . S PXVISIT=$O(^TMP("PXKCO",$J,0))
"RTN","PXKMAIN",180,0)
 . Q:'PXVISIT
"RTN","PXKMAIN",181,0)
 . S PX0=$G(^TMP("PXKCO",$J,PXVISIT,"VST",PXVISIT,0,"AFTER"))
"RTN","PXKMAIN",182,0)
 . Q:PX0=""
"RTN","PXKMAIN",183,0)
 . D L2
"RTN","PXKMAIN",184,0)
 ;Fourth case: Uses "PXKENC" instead of "PXK".
"RTN","PXKMAIN",185,0)
 I PXEXIT,$D(^TMP("PXKENC",$J)) D
"RTN","PXKMAIN",186,0)
 . S PXVISIT=$O(^TMP("PXKENC",$J,0))
"RTN","PXKMAIN",187,0)
 . Q:'PXVISIT
"RTN","PXKMAIN",188,0)
 . S PX0=$G(^TMP("PXKENC",$J,PXVISIT,"VST",PXVISIT,0)) ; Look at ^TMP("PXKENC",$J
"RTN","PXKMAIN",189,0)
 . Q:PX0=""
"RTN","PXKMAIN",190,0)
 . D L2
"RTN","PXKMAIN",191,0)
 I PXEXIT Q  ; Unable to obtain non-null subscripts.
"RTN","PXKMAIN",192,0)
 S PXP59LOC=$NA(^PXLOCK(PXWHO,PXWHERE,PXWHEN))
"RTN","PXKMAIN",193,0)
 L +@PXP59LOC:300
"RTN","PXKMAIN",194,0)
 E  K PXP59LOC ; Lock was unsuccessful.
"RTN","PXKMAIN",195,0)
 Q
"RTN","PXKMAIN",196,0)
L2 ; Get values from visit 0 node (PX0).
"RTN","PXKMAIN",197,0)
 I 'PXWHO S PXWHO=$P(PX0,U,5)
"RTN","PXKMAIN",198,0)
 I 'PXWHEN S PXWHEN=$P(PX0,U,1)
"RTN","PXKMAIN",199,0)
 I 'PXWHERE S PXWHERE=+$P(PX0,U,22)
"RTN","PXKMAIN",200,0)
 I PXWHO,PXWHEN S PXEXIT=0
"RTN","PXKMAIN",201,0)
 Q
"RTN","PXKMAIN",202,0)
UNLOCK ; Unlock (use info in PXP59LOC)--Patch PX*1.0*59.
"RTN","PXKMAIN",203,0)
 L -@PXP59LOC
"RTN","PXKMAIN",204,0)
 Q
"RTN","PXKMAIN",205,0)
 ;
"RTN","PXKMAIN",206,0)
CQDEL ;Classification question deletion check
"RTN","PXKMAIN",207,0)
 I PXKCAT'="VST" Q
"RTN","PXKMAIN",208,0)
 S PXJ="" F  S PXJ=$O(PXKBV(800,PXJ)) Q:'PXJ  I PXKBV(800,PXJ)'="" I '$D(PXKAV(800,PXJ)) S PXKAV(800,PXJ)="@"
"RTN","PXKMAIN",209,0)
 K PXJ Q
"RTN","PXKMAIN1")
0^7^B39993012^B37490228
"RTN","PXKMAIN1",1,0)
PXKMAIN1 ;ISL/JVS,ISA/Zoltan - Main Routine for Data Capture ;04/15/15  10:10
"RTN","PXKMAIN1",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**22,73,124,178,210**;Aug 12, 1996;Build 11
"RTN","PXKMAIN1",3,0)
 ;+This routine is responsible for:
"RTN","PXKMAIN1",4,0)
 ;+ - creating new entries in PCE files,
"RTN","PXKMAIN1",5,0)
 ;+ - processing modifications to existing entries,
"RTN","PXKMAIN1",6,0)
 ;+ - deleting entries,
"RTN","PXKMAIN1",7,0)
 ;+ - ensuring all required variables are present,
"RTN","PXKMAIN1",8,0)
 ;+ - setting both Audit fields (EDITED FLAG and AUDIT TRAIL),
"RTN","PXKMAIN1",9,0)
 ;+ - checking for duplicate entries,
"RTN","PXKMAIN1",10,0)
 ;+ - some error reporting.
"RTN","PXKMAIN1",11,0)
 ;+
"RTN","PXKMAIN1",12,0)
 ;+LOCAL VARIABLE LIST
"RTN","PXKMAIN1",13,0)
 ;+ MOST VARIABLES ARE DEFINED AT THE TOP OF  PXKMAIN
"RTN","PXKMAIN1",14,0)
 ;+ PXKSEQ   = Sequence number in PXK tmp global
"RTN","PXKMAIN1",15,0)
 ;+ PXKCAT   = Category of entry (CPT,MSR,VST...)
"RTN","PXKMAIN1",16,0)
 ;+ PXKREF   = Root of temp global
"RTN","PXKMAIN1",17,0)
 ;+ PXKPIEN  = IEN of v file
"RTN","PXKMAIN1",18,0)
 ;+ PXKAUDIT = data located in the audit field of the v file
"RTN","PXKMAIN1",19,0)
 ;+ PXKER    = field data use to build the dr string (eg .04///^S X=$G()
"RTN","PXKMAIN1",20,0)
 ;+ PXKFLD   = field number gleened from the file routines
"RTN","PXKMAIN1",21,0)
 ;+ PXKNOD   = same as the subscript in a global node
"RTN","PXKMAIN1",22,0)
 ;+ PXKPCE   = the piece where the data is found on that node
"RTN","PXKMAIN1",23,0)
 ;
"RTN","PXKMAIN1",24,0)
 ;
"RTN","PXKMAIN1",25,0)
 W !,"This is not an entry point" Q
"RTN","PXKMAIN1",26,0)
LOOP ;+Copy delimited strings into sub-arrays.
"RTN","PXKMAIN1",27,0)
 F PXKI=1:1:$L(PXKAFT(PXKSUB),"^") I $P(PXKAFT(PXKSUB),"^",PXKI)'="" S PXKAV(PXKSUB,PXKI)=$P(PXKAFT(PXKSUB),"^",PXKI)
"RTN","PXKMAIN1",28,0)
 F PXKI=1:1:$L(PXKBEF(PXKSUB),"^") I $P(PXKBEF(PXKSUB),"^",PXKI)'="" S PXKBV(PXKSUB,PXKI)=$P(PXKBEF(PXKSUB),"^",PXKI)
"RTN","PXKMAIN1",29,0)
 K PXKI,PXKJ ; Not sure if NEW would be OK.
"RTN","PXKMAIN1",30,0)
 I PXKCAT="CPT",PXKSUB=1 D LOOP^PXKMOD
"RTN","PXKMAIN1",31,0)
 Q
"RTN","PXKMAIN1",32,0)
 ;
"RTN","PXKMAIN1",33,0)
ERROR ;+Check for missing required fields
"RTN","PXKMAIN1",34,0)
 Q:$G(PXKAV(0,1))["@"!('$D(PXKAV(0,1)))
"RTN","PXKMAIN1",35,0)
 S PXKNOD=0,PXKPCE=0
"RTN","PXKMAIN1",36,0)
 D EN1^@PXKRTN
"RTN","PXKMAIN1",37,0)
 S PXKER=$P(PXKER," * ",1)
"RTN","PXKMAIN1",38,0)
 I PXKER="" Q
"RTN","PXKMAIN1",39,0)
 F PXJ=1:1:$L(PXKER,",") D
"RTN","PXKMAIN1",40,0)
 . S PXJJ=$P(PXKER,",",PXJ)
"RTN","PXKMAIN1",41,0)
 . I '$D(PXKAV(PXKNOD,PXJJ)) D
"RTN","PXKMAIN1",42,0)
 . . S PXKPCE=PXJJ
"RTN","PXKMAIN1",43,0)
 . . D EN2^@PXKRTN
"RTN","PXKMAIN1",44,0)
 . . S PXKFLD=$P(PXKFD,"/",1)
"RTN","PXKMAIN1",45,0)
 . . S:PXKFLD["*" PXKFLD=$P(PXKFLD," * ",2)
"RTN","PXKMAIN1",46,0)
 . . S PXKERROR(PXKCAT,PXKSEQ,0,PXKFLD)="Missing Required Fields"
"RTN","PXKMAIN1",47,0)
 K PXK,PXJJ,PXKFLD,PXKFD ; Not sure about use of NEW here.
"RTN","PXKMAIN1",48,0)
 Q
"RTN","PXKMAIN1",49,0)
 ;
"RTN","PXKMAIN1",50,0)
CLEAN ;--Clean out the PXKAV array
"RTN","PXKMAIN1",51,0)
 S PXKJ=""
"RTN","PXKMAIN1",52,0)
 F  S PXKJ=$O(PXKBV(PXKJ)) Q:PXKJ=""  D
"RTN","PXKMAIN1",53,0)
 . I PXKCAT="IMM",PXKJ?1(1"2",1"3",1"11") D CLEAN^PXKIMM(PXKJ) Q
"RTN","PXKMAIN1",54,0)
 . S PXKI=""
"RTN","PXKMAIN1",55,0)
 . F  S PXKI=$O(PXKBV(PXKJ,PXKI)) Q:PXKI=""  D
"RTN","PXKMAIN1",56,0)
 . . I $G(PXKBV(PXKJ,PXKI))=$G(PXKAV(PXKJ,PXKI)) K PXKAV(PXKJ,PXKI)
"RTN","PXKMAIN1",57,0)
 K PXKI,PXKJ ; Not sure about NEW here.
"RTN","PXKMAIN1",58,0)
 Q
"RTN","PXKMAIN1",59,0)
 ;
"RTN","PXKMAIN1",60,0)
FILE ;+Create a new entry in file and get IEN
"RTN","PXKMAIN1",61,0)
 ;+This is the code that adds new entries to V-files
"RTN","PXKMAIN1",62,0)
 ;+and to the Visit file.
"RTN","PXKMAIN1",63,0)
 K DD,DO
"RTN","PXKMAIN1",64,0)
 S DIC=$P($T(GLOBAL^@PXKRTN),";;",2)_"("
"RTN","PXKMAIN1",65,0)
 S DIC(0)=""
"RTN","PXKMAIN1",66,0)
 S X=$G(PXKAV(0,1))
"RTN","PXKMAIN1",67,0)
 D FILE^DICN
"RTN","PXKMAIN1",68,0)
 S (PXKPIEN,DA)=+Y
"RTN","PXKMAIN1",69,0)
 S DR=""
"RTN","PXKMAIN1",70,0)
 K DIC,Y,X
"RTN","PXKMAIN1",71,0)
 Q
"RTN","PXKMAIN1",72,0)
 ;
"RTN","PXKMAIN1",73,0)
AUD12 ;--Set both audit fields
"RTN","PXKMAIN1",74,0)
 S DR=""
"RTN","PXKMAIN1",75,0)
 S PXKAUDIT=$P($T(GLOBAL^@PXKRTN),";;",2)_"(DA,801)"
"RTN","PXKMAIN1",76,0)
 S PXKAUDIT=$P($G(@PXKAUDIT),"^",2)_PXKSORR_";"
"RTN","PXKMAIN1",77,0)
 I $L(PXKAUDIT,";")>5 S $P(PXKAUDIT,";",2,$L(PXKAUDIT,";"))="+;"_$P(PXKAUDIT,";",4,$L(PXKAUDIT,";")) ;PX*1*124   Change 8 to 5
"RTN","PXKMAIN1",78,0)
 S PXKNOD=801
"RTN","PXKMAIN1",79,0)
 S DR=""
"RTN","PXKMAIN1",80,0)
 F PXKPCE=1,2 D EN1^@PXKRTN S DR=DR_PXKER
"RTN","PXKMAIN1",81,0)
 S PXKFVDLM=""
"RTN","PXKMAIN1",82,0)
 Q
"RTN","PXKMAIN1",83,0)
 ;
"RTN","PXKMAIN1",84,0)
AUD2 ;--Set second audit fields
"RTN","PXKMAIN1",85,0)
 S DR=""
"RTN","PXKMAIN1",86,0)
 S PXKAUDIT=$P($T(GLOBAL^@PXKRTN),";;",2)_"(DA,801)"
"RTN","PXKMAIN1",87,0)
 S PXKAUDIT=$P($G(@PXKAUDIT),"^",2)_PXKSORR_";"
"RTN","PXKMAIN1",88,0)
 I $L(PXKAUDIT,";")>5 S $P(PXKAUDIT,";",2,$L(PXKAUDIT,";"))="+;"_$P(PXKAUDIT,";",4,$L(PXKAUDIT,";")) ;PX*1*124   Change 8 to 5
"RTN","PXKMAIN1",89,0)
 S PXKNOD=801
"RTN","PXKMAIN1",90,0)
 S DR=""
"RTN","PXKMAIN1",91,0)
 S PXKPCE=2
"RTN","PXKMAIN1",92,0)
 D EN1^@PXKRTN
"RTN","PXKMAIN1",93,0)
 S DR=DR_PXKER
"RTN","PXKMAIN1",94,0)
 S PXKFVDLM=""
"RTN","PXKMAIN1",95,0)
 Q
"RTN","PXKMAIN1",96,0)
 ;
"RTN","PXKMAIN1",97,0)
DRDIE ;--Set the DR string and DO DIE
"RTN","PXKMAIN1",98,0)
 I PXKCAT="VST" D UPD^PXKFVST Q
"RTN","PXKMAIN1",99,0)
 ;
"RTN","PXKMAIN1",100,0)
 S DIE=$P($T(GLOBAL^@PXKRTN),";;",2)_"(" K PXKPTR
"RTN","PXKMAIN1",101,0)
 S PXKLR=$P($T(GLOBAL^@PXKRTN),";;",2)_"(DA)"
"RTN","PXKMAIN1",102,0)
 ;
"RTN","PXKMAIN1",103,0)
 S PXKNOD=""
"RTN","PXKMAIN1",104,0)
 F  S PXKNOD=$O(PXKAV(PXKNOD)) Q:PXKNOD=""  D
"RTN","PXKMAIN1",105,0)
 . I PXKFGAD=1,PXKNOD=0 S PXKPCE=1 D
"RTN","PXKMAIN1",106,0)
 .. Q:PXKCAT'="CPT"
"RTN","PXKMAIN1",107,0)
 .. I $G(^TMP("PXK",$J,PXKCAT,PXKSEQ,"IEN"))=PXKPIEN S PXKPCE=3
"RTN","PXKMAIN1",108,0)
 . I PXKFGAD=1,PXKNOD'=0 S PXKPCE=0
"RTN","PXKMAIN1",109,0)
 . I PXKFGED=1 S PXKPCE=0
"RTN","PXKMAIN1",110,0)
 . I PXKCAT="CPT",PXKNOD=1 D  Q
"RTN","PXKMAIN1",111,0)
 .. D DIE
"RTN","PXKMAIN1",112,0)
 .. I $G(^TMP("PXK",$J,PXKCAT,PXKSEQ,"IEN"))]"" Q
"RTN","PXKMAIN1",113,0)
 .. D UPD^PXKMOD
"RTN","PXKMAIN1",114,0)
 . ;
"RTN","PXKMAIN1",115,0)
 . I PXKCAT="IMM",PXKNOD?1(1"2",1"3",1"11") D DIE^PXKIMM Q
"RTN","PXKMAIN1",116,0)
 . ;
"RTN","PXKMAIN1",117,0)
 . F  S PXKPCE=$O(PXKAV(PXKNOD,PXKPCE)) Q:PXKPCE=""  D
"RTN","PXKMAIN1",118,0)
 ..D EN1^@PXKRTN
"RTN","PXKMAIN1",119,0)
 ..I $G(PXKER)'="" D
"RTN","PXKMAIN1",120,0)
 ...I PXKER["~" D
"RTN","PXKMAIN1",121,0)
 ....I $P(PXKER,"~",2)["A",PXKFGAD=1 S PXKER=$P(PXKER,"~") Q
"RTN","PXKMAIN1",122,0)
 ....I $P(PXKER,"~",2)'["A",PXKFGAD=1 S PXKER="" Q
"RTN","PXKMAIN1",123,0)
 ....I $P(PXKER,"~",2)["E",PXKFGED=1 S PXKER=$P(PXKER,"~") Q
"RTN","PXKMAIN1",124,0)
 ....I $P(PXKER,"~",2)'["E",PXKFGED=1 S PXKER="" Q
"RTN","PXKMAIN1",125,0)
 ...I +PXKER=0 D
"RTN","PXKMAIN1",126,0)
 ....I PXKAV(PXKNOD,PXKPCE)=+PXKAV(PXKNOD,PXKPCE) S PXKER=$P(PXKER," * ",2)
"RTN","PXKMAIN1",127,0)
 ....I PXKAV(PXKNOD,PXKPCE)'=+PXKAV(PXKNOD,PXKPCE) S PXKER=$P(PXKER," * ",3),PXKPTR(PXKPIEN,PXKNOD,PXKPCE)=""
"RTN","PXKMAIN1",128,0)
 ..I $G(PXKER)'="" S DR=DR_PXKER_"PXKAV("_PXKNOD_","_PXKPCE_"));"
"RTN","PXKMAIN1",129,0)
 ..I $L(DR)>200 D DIE
"RTN","PXKMAIN1",130,0)
 D DIE
"RTN","PXKMAIN1",131,0)
 K DIE,PXKLR,DIC(0)
"RTN","PXKMAIN1",132,0)
 D ER
"RTN","PXKMAIN1",133,0)
 Q
"RTN","PXKMAIN1",134,0)
DIE ;+Lock global and invoke FM ^DIE call.
"RTN","PXKMAIN1",135,0)
 L +@PXKLR:10
"RTN","PXKMAIN1",136,0)
 D ^DIE
"RTN","PXKMAIN1",137,0)
 L -@PXKLR
"RTN","PXKMAIN1",138,0)
 K DR
"RTN","PXKMAIN1",139,0)
 S DR=""
"RTN","PXKMAIN1",140,0)
 Q
"RTN","PXKMAIN1",141,0)
 ;
"RTN","PXKMAIN1",142,0)
DELETE ;+Use FM ^DIK call to delete entry identified by PXKPIEN.
"RTN","PXKMAIN1",143,0)
 S DA=PXKPIEN
"RTN","PXKMAIN1",144,0)
 S DIK=$P($T(GLOBAL^@PXKRTN),";;",2)_"("
"RTN","PXKMAIN1",145,0)
 D ^DIK
"RTN","PXKMAIN1",146,0)
 K DIK
"RTN","PXKMAIN1",147,0)
 Q
"RTN","PXKMAIN1",148,0)
 ;
"RTN","PXKMAIN1",149,0)
DUP ;+Code to check for duplicates
"RTN","PXKMAIN1",150,0)
 I PXKCAT="VST" Q
"RTN","PXKMAIN1",151,0)
 I PXKCAT="CPT" Q
"RTN","PXKMAIN1",152,0)
 I PXKCAT="HF" Q
"RTN","PXKMAIN1",153,0)
 N PXKRTN
"RTN","PXKMAIN1",154,0)
 I '$D(PXKPIEN) N PXKPIEN S PXKPIEN=""
"RTN","PXKMAIN1",155,0)
 S PXKNOD=0
"RTN","PXKMAIN1",156,0)
 S PXKPCE=0
"RTN","PXKMAIN1",157,0)
 S PXKRTN="PXKF"_PXKVCAT
"RTN","PXKMAIN1",158,0)
 S PXKVRTN=$P($T(GLOBAL^@PXKRTN),";;",2)
"RTN","PXKMAIN1",159,0)
 S PXJJJ=0
"RTN","PXKMAIN1",160,0)
 D EN1^@PXKRTN
"RTN","PXKMAIN1",161,0)
 I $P(PXKER," * ",3)'=0 D
"RTN","PXKMAIN1",162,0)
 .S PXKER=$P(PXKER," * ",2)
"RTN","PXKMAIN1",163,0)
 .I PXKER="" Q
"RTN","PXKMAIN1",164,0)
 .S (PX,PXFG)=0
"RTN","PXKMAIN1",165,0)
 .F  S PX=$O(@PXKVRTN@("AD",PXKVST,PX)) Q:PX=""  D  Q:PXFG=1
"RTN","PXKMAIN1",166,0)
 ..S PXJJJ=0
"RTN","PXKMAIN1",167,0)
 ..F PXJ=1:1:$L(PXKER,",") S PXJJ=$P(PXKER,",",PXJ) D
"RTN","PXKMAIN1",168,0)
 ...I $P($G(@PXKVRTN@(PX,$P(PXJJ,"+",1))),"^",$P(PXJJ,"+",2))=$G(PXKAV($P(PXJJ,"+",1),$P(PXJJ,"+",2))),PX'=PXKPIEN S PXJJJ=PXJJJ+1
"RTN","PXKMAIN1",169,0)
 ..I $L(PXKER,",")=PXJJJ S PXFG=1
"RTN","PXKMAIN1",170,0)
 ;PXKHLR Is not killed because it is a flag comming from another routine
"RTN","PXKMAIN1",171,0)
 Q
"RTN","PXKMAIN1",172,0)
 ;
"RTN","PXKMAIN1",173,0)
ER ;--PXKERROR MAKING IF NOT POPULATED CORRECTLY
"RTN","PXKMAIN1",174,0)
 N PXKRT,PXKMOD,PXKSTR
"RTN","PXKMAIN1",175,0)
 S PXKMOD=PXKSEQ#1 I $G(PXKMOD) Q
"RTN","PXKMAIN1",176,0)
 S PXKN=""
"RTN","PXKMAIN1",177,0)
 F  S PXKN=$O(PXKAV(PXKN)) Q:PXKN=""  D
"RTN","PXKMAIN1",178,0)
 . I PXKCAT="IMM",PXKN?1(1"2",1"3",1"11") D ER^PXKIMM Q
"RTN","PXKMAIN1",179,0)
 . S PXKP=""
"RTN","PXKMAIN1",180,0)
 . F  S PXKP=$O(PXKAV(PXKN,PXKP)) Q:PXKP=""  D
"RTN","PXKMAIN1",181,0)
 .. S PXKRRT=$P($T(GLOBAL^@PXKRTN),";;",2)_"("_DA_","
"RTN","PXKMAIN1",182,0)
 .. I PXKN=1,PXKCAT="CPT" S PXKRRT=PXKRRT_PXKN_","_PXKP_","_0_")"
"RTN","PXKMAIN1",183,0)
 .. E  S PXKRRT=PXKRRT_PXKN_")"
"RTN","PXKMAIN1",184,0)
 .. I PXKAV(PXKN,PXKP)'=$P($G(@PXKRRT),"^",$S(PXKN=1:1,1:PXKP)) D
"RTN","PXKMAIN1",185,0)
 ... Q:PXKAV(PXKN,PXKP)["@"
"RTN","PXKMAIN1",186,0)
 ... S PXKNOD=PXKN,PXKPCE=PXKP
"RTN","PXKMAIN1",187,0)
 ... I PXKNOD=1,PXKCAT="CPT" S PXKPCE=1
"RTN","PXKMAIN1",188,0)
 ... D EN2^@PXKRTN
"RTN","PXKMAIN1",189,0)
 ... S PXKFLD=$P(PXKFD,"/",1)
"RTN","PXKMAIN1",190,0)
 ... S:PXKFLD["*" PXKFLD=$P(PXKFLD," * ",2)
"RTN","PXKMAIN1",191,0)
 ... Q:PXKFLD=1101
"RTN","PXKMAIN1",192,0)
 ... S PXKSTR="Not Stored = "_PXKAV(PXKN,PXKP)
"RTN","PXKMAIN1",193,0)
 ... I $G(PXKERROR(PXKCAT,PXKSEQ,DA,PXKFLD))]"" D
"RTN","PXKMAIN1",194,0)
 .... S PXKSTR=PXKERROR(PXKCAT,PXKSEQ,DA,PXKFLD)_","_PXKAV(PXKN,PXKP)
"RTN","PXKMAIN1",195,0)
 ... S PXKERROR(PXKCAT,PXKSEQ,DA,PXKFLD)=PXKSTR
"RTN","PXKMAIN1",196,0)
 Q
"RTN","PXKMASC")
0^8^B56481802^B46966195
"RTN","PXKMASC",1,0)
PXKMASC ;ISL/JVS - Build and Pass to auto-check-out ;04/15/15  10:14
"RTN","PXKMASC",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**22,41,73,164,210**;Aug 12, 1996;Build 11
"RTN","PXKMASC",3,0)
 ; Builds and passes data to MAS for Auto-checkout
"RTN","PXKMASC",4,0)
 ;Variable List
"RTN","PXKMASC",5,0)
 ;
"RTN","PXKMASC",6,0)
EN1 ;Build the Temp global for MAS AND THE WORLD.
"RTN","PXKMASC",7,0)
 ;S PXKGN=$P($T(GLOBAL^@PXKRTN),";;",2)_"("_PXKPIEN_","
"RTN","PXKMASC",8,0)
 ;^TMP("PXKCO",$J,<VISIT IEN>,"PRV",<PROVIDER ien>,0,"AFTER")=DATA
"RTN","PXKMASC",9,0)
 ;  ""                 ""                     ""    ,"BEFORE")=DATA
"RTN","PXKMASC",10,0)
 N PXKGG,PXKSUB,PXKMOD,PXKSEQ,PXKOE,PXKVAL
"RTN","PXKMASC",11,0)
 Q:PXKSOR=$O(^PX(839.7,"B","PIMS CHECK-OUT",0))
"RTN","PXKMASC",12,0)
 S PXKGG=0
"RTN","PXKMASC",13,0)
 S PXKSUB=""
"RTN","PXKMASC",14,0)
 F  S PXKSUB=$O(PXKAFT(PXKSUB)) Q:PXKSUB=""  D
"RTN","PXKMASC",15,0)
 . I PXKSUB'=1!(PXKCAT="IMM") D PXGO Q
"RTN","PXKMASC",16,0)
 . S PXKSEQ=""
"RTN","PXKMASC",17,0)
 . F  S PXKSEQ=$O(PXKAFT(PXKSUB,PXKSEQ)) Q:PXKSEQ=""  D
"RTN","PXKMASC",18,0)
 .. S PXKMOD=PXKAFT(PXKSUB,PXKSEQ)
"RTN","PXKMASC",19,0)
 .. D PXGO
"RTN","PXKMASC",20,0)
 Q
"RTN","PXKMASC",21,0)
PXGO ;
"RTN","PXKMASC",22,0)
 S PXKGG=0
"RTN","PXKMASC",23,0)
 S PXKGN=$P($T(GLOBAL^@PXKRTN),";;",2)_"("_PXKPIEN_","
"RTN","PXKMASC",24,0)
 I PXKSUB'=1!(PXKCAT="IMM") D
"RTN","PXKMASC",25,0)
 . I $D(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"BEFORE")) S PXKGG=1
"RTN","PXKMASC",26,0)
 . S PXKGN=PXKGN_PXKSUB_")"
"RTN","PXKMASC",27,0)
 I PXKSUB=1 D
"RTN","PXKMASC",28,0)
 . I PXKMOD]"",$D(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"BEFORE",PXKMOD)) S PXKGG=1
"RTN","PXKMASC",29,0)
 . S PXKGN=PXKGN_PXKSUB_","_PXKSEQ_","_0_")"
"RTN","PXKMASC",30,0)
 D @$S(PXKGG=1:"DUP",1:"ORG")
"RTN","PXKMASC",31,0)
 D DEL
"RTN","PXKMASC",32,0)
 D PTR
"RTN","PXKMASC",33,0)
 Q
"RTN","PXKMASC",34,0)
 ;
"RTN","PXKMASC",35,0)
DUP ;Overwrite if a duplicate just the After Node
"RTN","PXKMASC",36,0)
 I PXKCAT="IMM",PXKSUB?1(1"2",1"3",1"11") D  Q
"RTN","PXKMASC",37,0)
 . N PXKMIEN
"RTN","PXKMASC",38,0)
 . S PXKMIEN=0
"RTN","PXKMASC",39,0)
 . F  S PXKMIEN=$O(@PXKGN@(PXKMIEN)) Q:'PXKMIEN  D
"RTN","PXKMASC",40,0)
 .. S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"AFTER",PXKMIEN)=$G(@PXKGN@(PXKMIEN,0))
"RTN","PXKMASC",41,0)
 I PXKSUB'=1 D  Q
"RTN","PXKMASC",42,0)
 . S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"AFTER")=$G(@PXKGN)
"RTN","PXKMASC",43,0)
 I $G(@PXKGN)]"" D
"RTN","PXKMASC",44,0)
 . S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"AFTER",$G(@PXKGN))=""
"RTN","PXKMASC",45,0)
 Q
"RTN","PXKMASC",46,0)
 ;
"RTN","PXKMASC",47,0)
ORG ;If original copy both
"RTN","PXKMASC",48,0)
 ;
"RTN","PXKMASC",49,0)
 I PXKCAT="IMM",PXKSUB?1(1"2",1"3",1"11") D  Q
"RTN","PXKMASC",50,0)
 . N PXKMIEN
"RTN","PXKMASC",51,0)
 . ;
"RTN","PXKMASC",52,0)
 . ; Set BEFORE Immunization Multiples
"RTN","PXKMASC",53,0)
 . S PXKMIEN=0
"RTN","PXKMASC",54,0)
 . F  S PXKMIEN=$O(PXKBEF(PXKSUB,PXKMIEN)) Q:'PXKMIEN  D
"RTN","PXKMASC",55,0)
 . . S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"BEFORE",PXKMIEN)=PXKBEF(PXKSUB,PXKMIEN)
"RTN","PXKMASC",56,0)
 . ; Set AFTER Immunization Multiples
"RTN","PXKMASC",57,0)
 . S PXKMIEN=0
"RTN","PXKMASC",58,0)
 . F  S PXKMIEN=$O(@PXKGN@(PXKMIEN)) Q:'PXKMIEN  D
"RTN","PXKMASC",59,0)
 .. S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"AFTER",PXKMIEN)=$G(@PXKGN@(PXKMIEN,0))
"RTN","PXKMASC",60,0)
 ;
"RTN","PXKMASC",61,0)
 I PXKSUB'=1 D  Q
"RTN","PXKMASC",62,0)
 . S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"AFTER")=$G(@PXKGN)
"RTN","PXKMASC",63,0)
 . S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"BEFORE")=$G(PXKBEF(PXKSUB))
"RTN","PXKMASC",64,0)
 I $G(@PXKGN)]"" D
"RTN","PXKMASC",65,0)
 . S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"AFTER",$G(@PXKGN))=""
"RTN","PXKMASC",66,0)
 I $G(PXKBEF(PXKSUB,PXKSEQ))]"" D
"RTN","PXKMASC",67,0)
 . S ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,PXKSUB,"BEFORE",PXKBEF(PXKSUB,PXKSEQ))=""
"RTN","PXKMASC",68,0)
 Q
"RTN","PXKMASC",69,0)
 ;
"RTN","PXKMASC",70,0)
DEL ;DELETE IF BOTH ARE NULL
"RTN","PXKMASC",71,0)
 I '$D(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,0)) D
"RTN","PXKMASC",72,0)
 .K ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN)
"RTN","PXKMASC",73,0)
 I $G(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,0,"AFTER"))']"" D
"RTN","PXKMASC",74,0)
 .I $G(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,0,"BEFORE"))']"" D
"RTN","PXKMASC",75,0)
 ..K ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN)
"RTN","PXKMASC",76,0)
 I $P($G(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN,0,"AFTER")),"^",1)="@" D
"RTN","PXKMASC",77,0)
 .K ^TMP("PXKCO",$J,PXKVST,PXKCAT,PXKPIEN)
"RTN","PXKMASC",78,0)
 Q
"RTN","PXKMASC",79,0)
 ;
"RTN","PXKMASC",80,0)
PTR ; Set the Provider Narrative equal to the pointer in the files etc.
"RTN","PXKMASC",81,0)
 N PXJ,PXJJ,PXJJJ,PXKR
"RTN","PXKMASC",82,0)
 I $D(PXKPTR) S PXJ="" F  S PXJ=$O(PXKPTR(PXJ)) Q:PXJ=""  D
"RTN","PXKMASC",83,0)
 .S PXJJ=""  F  S PXJJ=$O(PXKPTR(PXJ,PXJJ)) Q:PXJJ=""  D
"RTN","PXKMASC",84,0)
 ..S PXJJJ="" F  S PXJJJ=$O(PXKPTR(PXJ,PXJJ,PXJJJ)) Q:PXJJJ=""  D
"RTN","PXKMASC",85,0)
 ...S PXKR=$P($T(GLOBAL^@PXKRTN),";;",2)_"("_PXJ_","_PXJJ_")"
"RTN","PXKMASC",86,0)
 ...I $D(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXJ,PXJJ,"AFTER")) D
"RTN","PXKMASC",87,0)
 ....S $P(^TMP("PXKCO",$J,PXKVST,PXKCAT,PXJ,PXJJ,"AFTER"),"^",PXJJJ)=$P($G(@PXKR),"^",PXJJJ)
"RTN","PXKMASC",88,0)
 Q
"RTN","PXKMASC",89,0)
 ;
"RTN","PXKMASC",90,0)
EVENT ; EVENT TO PRESENT THE DATA TO OTHER USERS
"RTN","PXKMASC",91,0)
 Q:'$D(PXKCO("SOR"))
"RTN","PXKMASC",92,0)
 I '$D(^TMP("PXKCO",$J)) Q
"RTN","PXKMASC",93,0)
 S PXKVVST=+$O(^TMP("PXKCO",$J,0))
"RTN","PXKMASC",94,0)
 S ^TMP("PXKCO",$J,PXKVVST,"VST",PXKVVST,0,"AFTER")=$G(^AUPNVSIT(PXKVVST,0))
"RTN","PXKMASC",95,0)
 S ^TMP("PXKCO",$J,PXKVVST,"VST",PXKVVST,21,"AFTER")=$G(^AUPNVSIT(PXKVVST,21))
"RTN","PXKMASC",96,0)
 S ^TMP("PXKCO",$J,PXKVVST,"VST",PXKVVST,800,"AFTER")=$G(^AUPNVSIT(PXKVVST,800))
"RTN","PXKMASC",97,0)
 S ^TMP("PXKCO",$J,PXKVVST,"VST",PXKVVST,811,"AFTER")=$G(^AUPNVSIT(PXKVVST,811))
"RTN","PXKMASC",98,0)
 S ^TMP("PXKCO",$J,PXKVVST,"VST",PXKVVST,150,"AFTER")=$G(^AUPNVSIT(PXKVVST,150))
"RTN","PXKMASC",99,0)
 S ^TMP("PXKCO",$J,PXKVVST,"SOR",PXKCO("SOR"),0,"AFTER")=$G(^PX(839.7,PXKCO("SOR"),0))
"RTN","PXKMASC",100,0)
 S ^TMP("PXKCO",$J,PXKVVST,"SOR",PXKCO("SOR"),0,"BEFORE")=$G(^PX(839.7,PXKCO("SOR"),0))
"RTN","PXKMASC",101,0)
 S PXKOE=$O(^SCE("AVSIT",PXKVVST,"")) I PXKOE]"" S ^TMP("PXKCO",$J,PXKVVST,"OE",PXKOE,0,"BEFORE")=$G(^SCE(PXKOE,0))
"RTN","PXKMASC",102,0)
 S X=+$O(^ORD(101,"B","PXK VISIT DATA EVENT",0))_";ORD(101,"
"RTN","PXKMASC",103,0)
 ;D ENCEVENT^PXKENC(PXKVVST) ;makes the ^TMP("PXKENC",$J, array
"RTN","PXKMASC",104,0)
 D COEVENT^PXKENC(PXKVVST) ;finishes the ^TMP("PXKCO",$J array
"RTN","PXKMASC",105,0)
 D EN^XQOR
"RTN","PXKMASC",106,0)
 D FINAL^SCDXHLDR(PXKVVST,$G(PXKVST))
"RTN","PXKMASC",107,0)
UPD ;UP DATE VISIT FILE
"RTN","PXKMASC",108,0)
 ;--REMOVE CHECK OUT DATE TIME
"RTN","PXKMASC",109,0)
 N PXSWINFO S PXSWINFO=$$SWSTAT^IBBAPI()
"RTN","PXKMASC",110,0)
 N VSIT
"RTN","PXKMASC",111,0)
 I $D(PXKVVST),$D(^AUPNVSIT(PXKVVST)) S VSIT("IEN")=PXKVVST,VSIT("COD")="@" D CHKACCT D UPD^VSIT ;PX*1.0*164
"RTN","PXKMASC",112,0)
 I +PXSWINFO D
"RTN","PXKMASC",113,0)
 .I $P($G(^AUPNVSIT(PXKVVST,0)),"^",1)<$P(PXSWINFO,"^",2),$P($G(^TMP("PXKCO",$J,PXKVVST,"VST",PXKVVST,0,"BEFORE")),"^",1)<$P(PXSWINFO,"^",2) Q  ;Check visit for PFSS Activation date
"RTN","PXKMASC",114,0)
 .S ^TMP("PXKCO",$J,PXKVVST,"VST",PXKVVST,0,"AFTER")=$G(^AUPNVSIT(PXKVVST,0))
"RTN","PXKMASC",115,0)
 .S X=+$O(^ORD(101,"B","PX IBB CACHE FILING EVENT",0))_";ORD(101,"
"RTN","PXKMASC",116,0)
 .D EN^XQOR
"RTN","PXKMASC",117,0)
 K ^TMP("PXKCO",$J),PXKVVST,PXKCO,VSIT
"RTN","PXKMASC",118,0)
 K ^TMP("PXKENC",$J)
"RTN","PXKMASC",119,0)
 Q
"RTN","PXKMASC",120,0)
CHKACCT ;
"RTN","PXKMASC",121,0)
 N PXSWINFO S PXSWINFO=$$SWSTAT^IBBAPI()
"RTN","PXKMASC",122,0)
 N OUTENC,PXPV1,PXPV2,SEQ,PXCPT0,PXPRV0,PXOERR,PXCPT,PXORREF,PXPROS
"RTN","PXKMASC",123,0)
 Q:'+PXSWINFO
"RTN","PXKMASC",124,0)
 Q:$P($G(^AUPNVSIT(PXKVVST,0)),"^",1)<$P(PXSWINFO,"^",2)  ;Check visit for PFSS Activation date
"RTN","PXKMASC",125,0)
 Q:$P($G(^AUPNVSIT(PXKVVST,0)),"^",7)="E"  ;NO ACCOUNT # FOR HISTORIC ENCOUNTERS
"RTN","PXKMASC",126,0)
 Q:$P($G(^AUPNVSIT(PXKVVST,0)),"^",7)="H"  ;NO ACCOUNT # FOR HOSPTIALIZATION ENCOUNTERS
"RTN","PXKMASC",127,0)
 Q:$P($G(^AUPNVSIT(PXKVVST,812)),"^",2)=$$PKG2IEN^VSIT("RMPR")  ;NO ACCOUNT # FOR PROSTHETICS
"RTN","PXKMASC",128,0)
 ;Check for existing ACT
"RTN","PXKMASC",129,0)
 S VSIT("ACT")=$P($G(^AUPNVSIT(PXKVVST,0)),"^",26) Q:VSIT("ACT")
"RTN","PXKMASC",130,0)
 ;Check Scheduling
"RTN","PXKMASC",131,0)
 I $T(GETARN^SDPFSS2)'="" S VSIT("ACT")=$$GETARN^SDPFSS2($P(^AUPNVSIT(PXKVVST,0),"^",1),$P(^AUPNVSIT(PXKVVST,0),"^",5),$P(^AUPNVSIT(PXKVVST,0),"^",22)) Q:VSIT("ACT")]0  S VSIT("ACT")=""
"RTN","PXKMASC",132,0)
 ;Check CPT codes for Lab 108, call ORWPFSS,
"RTN","PXKMASC",133,0)
 I $E($T(ORACTREF^ORWPFSS),9)="(" S PXOERR=1 D  Q:PXOERR
"RTN","PXKMASC",134,0)
 .I '$D(^TMP("PXKCO",$J,PXKVVST,"CPT")) S PXOERR=0 Q  ;No CPT codes, so Get Acct Ref
"RTN","PXKMASC",135,0)
 .S SEQ="" F  S SEQ=$O(^TMP("PXKCO",$J,PXKVVST,"CPT",SEQ)) Q:SEQ=""  D  Q:'PXOERR
"RTN","PXKMASC",136,0)
 ..S PXCPT0=$G(^TMP("PXKCO",$J,PXKVVST,"CPT",SEQ,0,"AFTER"))
"RTN","PXKMASC",137,0)
 ..I $P(PXCPT0,"^",19)'=108 S PXOERR=0 Q  ;Not Lab, so Get Acct Ref
"RTN","PXKMASC",138,0)
 ..I $P(PXCPT0,"^",17)="" S PXOERR=0 Q  ;Lab and no Order Reference, so Get Acct Ref
"RTN","PXKMASC",139,0)
 ..I $P(PXCPT0,"^",17)'="" S PXCPT=$P(PXCPT0,"^",17) D ORACTREF^ORWPFSS(.PXORREF,.PXCPT) I PXORREF'>0 S PXOERR=0  ;Lab and no Acct Ref, so Get Acct Ref
"RTN","PXKMASC",140,0)
 ;Call Get IBBACCT
"RTN","PXKMASC",141,0)
 S PXPV1(2)=$P(^AUPNVSIT(PXKVVST,150),"^",2) S PXPV1(2)=$S(PXPV1(2)=1:"I",PXPV1(2)=0:"O",1:"") ;Inpatient, Outpatient
"RTN","PXKMASC",142,0)
 S PXPV1(3)=$P(^AUPNVSIT(PXKVVST,0),"^",22) Q:PXPV1(3)=""  ;Hospital Location, Quit for Outside Locations
"RTN","PXKMASC",143,0)
 S OUTENC=$O(^SCE("AVSIT",PXKVVST,0)) I OUTENC]"" S PXPV1(4)=$P(^SCE(OUTENC,0),"^",10) ;Appointment type
"RTN","PXKMASC",144,0)
 ;Attending search
"RTN","PXKMASC",145,0)
 S PXPV1(7)=""
"RTN","PXKMASC",146,0)
 S SEQ="" F  S SEQ=$O(^TMP("PXKCO",$J,PXKVVST,"PRV",SEQ)) Q:SEQ=""  D  Q:PXPV1(7)]""
"RTN","PXKMASC",147,0)
 .S PXPRV0=$G(^TMP("PXKCO",$J,PXKVVST,"PRV",SEQ,0,"AFTER"))
"RTN","PXKMASC",148,0)
 .I $P(PXPRV0,"^",5)="A" S PXPV1(7)=$P(PXPRV0,"^",1)
"RTN","PXKMASC",149,0)
 S PXPV1(18)=$P(^AUPNVSIT(PXKVVST,0),"^",8) ;DSS ID
"RTN","PXKMASC",150,0)
 S PXPV1(44)=$P(^AUPNVSIT(PXKVVST,0),"^",1) ;Visit D/T
"RTN","PXKMASC",151,0)
 S PXPV2(7)="" S:$P(^AUPNVSIT(PXKVVST,0),"^",21) PXPV2(7)=$P(^DIC(8,$P(^AUPNVSIT(PXKVVST,0),"^",21),0),"^",9) ;Eligibility
"RTN","PXKMASC",152,0)
 S VSIT("PAT")=$P(^AUPNVSIT(PXKVVST,0),"^",5)
"RTN","PXKMASC",153,0)
 S VSIT("ACT")=$$GETACCT^IBBAPI(VSIT("PAT"),"","A04","PXKMASC",.PXPV1,.PXPV2,,,,"","")
"RTN","PXKMASC",154,0)
 K VSIT("PAT")
"RTN","PXPXRM")
0^10^B88904295^B24754616
"RTN","PXPXRM",1,0)
PXPXRM ;SLC/PKR - APIs for Clinical Reminder indexes. ;08/19/15  17:09
"RTN","PXPXRM",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**119,199,210**;Aug 12, 1996;Build 11
"RTN","PXPXRM",3,0)
 ;
"RTN","PXPXRM",4,0)
 ; Reference to CODEC^ICDEX supported by ICR #5747
"RTN","PXPXRM",5,0)
 ; Reference to CSI^ICDEX supported by ICR #5747
"RTN","PXPXRM",6,0)
 ; Reference to SINFO^ICDEX supported by ICR #5747
"RTN","PXPXRM",7,0)
 ;
"RTN","PXPXRM",8,0)
 Q
"RTN","PXPXRM",9,0)
 ;===============================================================
"RTN","PXPXRM",10,0)
KVFILE(FILENUM,X,DA) ;Delete indexes for a regular V File.
"RTN","PXPXRM",11,0)
 N CVX,VDATE,VISIT
"RTN","PXPXRM",12,0)
 S VISIT=$G(^AUPNVSIT(X(3),0))
"RTN","PXPXRM",13,0)
 I VISIT="" Q
"RTN","PXPXRM",14,0)
 S VDATE=$P(VISIT,U,1)
"RTN","PXPXRM",15,0)
 ;
"RTN","PXPXRM",16,0)
 I FILENUM=9000010.11 D  ; if V IMMUNIZATION: kill CVX index; and use Event DT, if available
"RTN","PXPXRM",17,0)
 . I $G(X(4)) S VDATE=X(4)
"RTN","PXPXRM",18,0)
 . S CVX=$P($G(^AUTTIMM(X(1),0)),U,3)
"RTN","PXPXRM",19,0)
 . I CVX'="" D
"RTN","PXPXRM",20,0)
 . . K ^PXRMINDX(FILENUM,"CVX","IP",CVX,X(2),VDATE,DA)
"RTN","PXPXRM",21,0)
 . . K ^PXRMINDX(FILENUM,"CVX","PI",X(2),CVX,VDATE,DA)
"RTN","PXPXRM",22,0)
 ;
"RTN","PXPXRM",23,0)
 K ^PXRMINDX(FILENUM,"IP",X(1),X(2),VDATE,DA)
"RTN","PXPXRM",24,0)
 K ^PXRMINDX(FILENUM,"PI",X(2),X(1),VDATE,DA)
"RTN","PXPXRM",25,0)
 Q
"RTN","PXPXRM",26,0)
 ;
"RTN","PXPXRM",27,0)
 ;===============================================================
"RTN","PXPXRM",28,0)
KVFILEC(FILENUM,X,DA) ;Delete indexes for V Files with coded entries.
"RTN","PXPXRM",29,0)
 ; FILENUM = file number, e.g. 9000010.07
"RTN","PXPXRM",30,0)
 ;       X = Array of fields
"RTN","PXPXRM",31,0)
 ;           X(1) = Item pointer:  Dx for V POV, CPT for V CPT
"RTN","PXPXRM",32,0)
 ;           X(2) = PATIENT NAME (DFN)
"RTN","PXPXRM",33,0)
 ;           X(3) = VISIT (ptr to 9000010)
"RTN","PXPXRM",34,0)
 ;           X(4) = PRIMARY/SECONDARY for V POV
"RTN","PXPXRM",35,0)
 ;               or PRINCIPAL PROCEDURE FOR V CPT
"RTN","PXPXRM",36,0)
 ;      DA = IEN into FILENUM file
"RTN","PXPXRM",37,0)
 N CODE,CTYPE,PXCSYS,VDATE,VISIT
"RTN","PXPXRM",38,0)
 S VISIT=$G(^AUPNVSIT(X(3),0)) ; get Visit zero node
"RTN","PXPXRM",39,0)
 I VISIT="" Q  ; if Visit not found, bail out
"RTN","PXPXRM",40,0)
 S CTYPE=$S(X(4)="":"U",1:X(4)) ; U if blank otherwise use value passed in
"RTN","PXPXRM",41,0)
 S VDATE=$P(VISIT,U,1) ; get Visit Date/Time from 1st piece of zero node
"RTN","PXPXRM",42,0)
 S PXCSYS="ICD"
"RTN","PXPXRM",43,0)
 I FILENUM=9000010.07 D  ; if V POV get Coding System type
"RTN","PXPXRM",44,0)
 . S PXCSYS=$P($$SINFO^ICDEX($$CSI^ICDEX(80,X(1))),U,3) ; coding system abbreviation
"RTN","PXPXRM",45,0)
 I PXCSYS'="ICD" D KVFILEV Q  ; if not ICD-9, use alternate format and Quit
"RTN","PXPXRM",46,0)
 ; the following is the original format used for V CPT and ICD-9 diagnoses
"RTN","PXPXRM",47,0)
 K ^PXRMINDX(FILENUM,"IPP",X(1),CTYPE,X(2),VDATE,DA) ; Kill the "IPP" node
"RTN","PXPXRM",48,0)
 K ^PXRMINDX(FILENUM,"PPI",X(2),CTYPE,X(1),VDATE,DA) ; Kill the "PPI" node
"RTN","PXPXRM",49,0)
 Q
"RTN","PXPXRM",50,0)
 ;
"RTN","PXPXRM",51,0)
 ;===============================================================
"RTN","PXPXRM",52,0)
KVFILEV ; alternate index format for ICD-10 and higher, added with PX*1.0*199
"RTN","PXPXRM",53,0)
 S CODE=$$CODEC^ICDEX(80,X(1)) ; convert IEN to Dx code
"RTN","PXPXRM",54,0)
 K ^PXRMINDX(FILENUM,PXCSYS,"IPP",CODE,CTYPE,X(2),VDATE,DA)
"RTN","PXPXRM",55,0)
 K ^PXRMINDX(FILENUM,PXCSYS,"PPI",X(2),CTYPE,CODE,VDATE,DA)
"RTN","PXPXRM",56,0)
 Q
"RTN","PXPXRM",57,0)
 ;
"RTN","PXPXRM",58,0)
 ;===============================================================
"RTN","PXPXRM",59,0)
SVFILE(FILENUM,X,DA) ;Set indexes for a regular V File.
"RTN","PXPXRM",60,0)
 ;X(1)=ITEM, X(2)=DFN, X(3)=VISIT.
"RTN","PXPXRM",61,0)
 ; for V IMMUNIZATION X(4)=EVENT DATE AND TIME
"RTN","PXPXRM",62,0)
 N CVX,VDATE,VISIT
"RTN","PXPXRM",63,0)
 S VISIT=$G(^AUPNVSIT(X(3),0))
"RTN","PXPXRM",64,0)
 I VISIT="" Q
"RTN","PXPXRM",65,0)
 S VDATE=$P(VISIT,U,1)
"RTN","PXPXRM",66,0)
 ;
"RTN","PXPXRM",67,0)
 I FILENUM=9000010.11 D  ; if V IMMUNIZATION: set CVX index; and use Event DT, if available
"RTN","PXPXRM",68,0)
 . I $G(X(4)) S VDATE=X(4)
"RTN","PXPXRM",69,0)
 . S CVX=$P($G(^AUTTIMM(X(1),0)),U,3)
"RTN","PXPXRM",70,0)
 . I CVX'="" D
"RTN","PXPXRM",71,0)
 . . S ^PXRMINDX(FILENUM,"CVX","IP",CVX,X(2),VDATE,DA)=""
"RTN","PXPXRM",72,0)
 . . S ^PXRMINDX(FILENUM,"CVX","PI",X(2),CVX,VDATE,DA)=""
"RTN","PXPXRM",73,0)
 ;
"RTN","PXPXRM",74,0)
 S ^PXRMINDX(FILENUM,"IP",X(1),X(2),VDATE,DA)=""
"RTN","PXPXRM",75,0)
 S ^PXRMINDX(FILENUM,"PI",X(2),X(1),VDATE,DA)=""
"RTN","PXPXRM",76,0)
 Q
"RTN","PXPXRM",77,0)
 ;
"RTN","PXPXRM",78,0)
 ;===============================================================
"RTN","PXPXRM",79,0)
SVFILEC(FILENUM,X,DA) ;Set indexes for V Files with coded entries. These
"RTN","PXPXRM",80,0)
 ;are V CPT and VPOV
"RTN","PXPXRM",81,0)
 ;X(1)=ITEM, X(2)=DFN, X(3)=VISIT,
"RTN","PXPXRM",82,0)
 ; for V CPT X(4)=PRINCIPAL PROCEDURE
"RTN","PXPXRM",83,0)
 ; for V POV X(4)=PRIMARY/SECONDARY
"RTN","PXPXRM",84,0)
 N CODE,CTYPE,PXCSYS,VDATE,VISIT
"RTN","PXPXRM",85,0)
 S VISIT=$G(^AUPNVSIT(X(3),0))
"RTN","PXPXRM",86,0)
 I VISIT="" Q
"RTN","PXPXRM",87,0)
 S CTYPE=$S(X(4)="":"U",1:X(4))
"RTN","PXPXRM",88,0)
 S VDATE=$P(VISIT,U,1)
"RTN","PXPXRM",89,0)
 S PXCSYS="ICD"
"RTN","PXPXRM",90,0)
 I FILENUM=9000010.07 D  ; if V POV get Coding System type
"RTN","PXPXRM",91,0)
 . S PXCSYS=$P($$SINFO^ICDEX($$CSI^ICDEX(80,X(1))),U,3) ; coding system abbreviation
"RTN","PXPXRM",92,0)
 I PXCSYS'="ICD" D SVFILEV Q  ; if not ICD-9 use alternate format and Quit
"RTN","PXPXRM",93,0)
 ; the following is the original format used for V CPT and ICD-9 diagnoses
"RTN","PXPXRM",94,0)
 S ^PXRMINDX(FILENUM,"IPP",X(1),CTYPE,X(2),VDATE,DA)=""
"RTN","PXPXRM",95,0)
 S ^PXRMINDX(FILENUM,"PPI",X(2),CTYPE,X(1),VDATE,DA)=""
"RTN","PXPXRM",96,0)
 Q
"RTN","PXPXRM",97,0)
 ;
"RTN","PXPXRM",98,0)
 ;===============================================================
"RTN","PXPXRM",99,0)
SVFILEV ; alternate index format for ICD-10 and higher, added with PX*1.0*199
"RTN","PXPXRM",100,0)
 S CODE=$$CODEC^ICDEX(80,X(1)) ; convert IEN to Dx code
"RTN","PXPXRM",101,0)
 S ^PXRMINDX(FILENUM,PXCSYS,"IPP",CODE,CTYPE,X(2),VDATE,DA)=""
"RTN","PXPXRM",102,0)
 S ^PXRMINDX(FILENUM,PXCSYS,"PPI",X(2),CTYPE,CODE,VDATE,DA)=""
"RTN","PXPXRM",103,0)
 Q
"RTN","PXPXRM",104,0)
 ;
"RTN","PXPXRM",105,0)
 ;===============================================================
"RTN","PXPXRM",106,0)
UPDCVX(IMM,CVXOLD,CVXNEW) ;
"RTN","PXPXRM",107,0)
 ; Update CVX Index on V Immunization file
"RTN","PXPXRM",108,0)
 ; Called from ACR cross-reference on Immunization file
"RTN","PXPXRM",109,0)
 N DA,PXDESC,PXRTN,PXTASK,PXVAR,PXVOTH,X,X1,X2
"RTN","PXPXRM",110,0)
 I CVXOLD=CVXNEW Q
"RTN","PXPXRM",111,0)
 S PXRTN="UPDCVXT^PXPXRM"
"RTN","PXPXRM",112,0)
 S PXDESC="Clinical Reminders CVX index update for V IMMUNIZATION"
"RTN","PXPXRM",113,0)
 S PXVAR="IMM;CVXOLD;CVXNEW"
"RTN","PXPXRM",114,0)
 S PXVOTH("ZTDTH")=$$NOW^XLFDT
"RTN","PXPXRM",115,0)
 S PXTASK=$$NODEV^XUTMDEVQ(PXRTN,PXDESC,PXVAR,.PXVOTH)
"RTN","PXPXRM",116,0)
 I PXTASK=-1 D UPDCVXT^PXPXRM
"RTN","PXPXRM",117,0)
 Q
"RTN","PXPXRM",118,0)
 ;
"RTN","PXPXRM",119,0)
 ;===============================================================
"RTN","PXPXRM",120,0)
UPDCVXT ;Tasked from UPDCVX.
"RTN","PXPXRM",121,0)
 ;Variables IMM, CVXOLD, and CVXNEW passed in via task
"RTN","PXPXRM",122,0)
 S ZTREQ="@"
"RTN","PXPXRM",123,0)
 N DATE,DFN,EDATE,VIMM,VISIT
"RTN","PXPXRM",124,0)
 S VIMM=0
"RTN","PXPXRM",125,0)
 F  S VIMM=$O(^AUPNVIMM("B",IMM,VIMM)) Q:'VIMM  D
"RTN","PXPXRM",126,0)
 . S DFN=$P($G(^AUPNVIMM(VIMM,0)),U,2)
"RTN","PXPXRM",127,0)
 . I 'DFN Q
"RTN","PXPXRM",128,0)
 . S VISIT=$P($G(^AUPNVIMM(VIMM,0)),U,3)
"RTN","PXPXRM",129,0)
 . S VISIT=$G(^AUPNVSIT(+VISIT,0))
"RTN","PXPXRM",130,0)
 . I VISIT="" Q
"RTN","PXPXRM",131,0)
 . S DATE=$P(VISIT,U,1)
"RTN","PXPXRM",132,0)
 . S EDATE=$P($G(^AUPNVIMM(VIMM,12)),U,1)
"RTN","PXPXRM",133,0)
 . I EDATE S DATE=EDATE
"RTN","PXPXRM",134,0)
 . I 'DATE Q
"RTN","PXPXRM",135,0)
 . I CVXOLD'="" D
"RTN","PXPXRM",136,0)
 . . K ^PXRMINDX(9000010.11,"CVX","IP",CVXOLD,DFN,DATE,VIMM)
"RTN","PXPXRM",137,0)
 . . K ^PXRMINDX(9000010.11,"CVX","PI",DFN,CVXOLD,DATE,VIMM)
"RTN","PXPXRM",138,0)
 . I CVXNEW'="" D
"RTN","PXPXRM",139,0)
 . . S ^PXRMINDX(9000010.11,"CVX","IP",CVXNEW,DFN,DATE,VIMM)=""
"RTN","PXPXRM",140,0)
 . . S ^PXRMINDX(9000010.11,"CVX","PI",DFN,CVXNEW,DATE,VIMM)=""
"RTN","PXPXRM",141,0)
 Q
"RTN","PXPXRM",142,0)
 ;
"RTN","PXPXRM",143,0)
 ;===============================================================
"RTN","PXPXRM",144,0)
VCPT(DA,DATA) ;Return data for a specified V CPT entry.
"RTN","PXPXRM",145,0)
 N TEMP
"RTN","PXPXRM",146,0)
 S TEMP=^AUPNVCPT(DA,0)
"RTN","PXPXRM",147,0)
 S DATA("VISIT")=$P(TEMP,U,3)
"RTN","PXPXRM",148,0)
 S DATA("PROVIDER NARRATIVE")=$P(TEMP,U,4)
"RTN","PXPXRM",149,0)
 S DATA("DIAGNOSIS")=$P(TEMP,U,5)
"RTN","PXPXRM",150,0)
 S DATA("PRINCIPAL PROCEDURE")=$P(TEMP,U,7)
"RTN","PXPXRM",151,0)
 S DATA("QUANTITY")=$P(TEMP,U,16)
"RTN","PXPXRM",152,0)
 S DATA("COMMENTS")=$G(^AUPNVCPT(DA,811))
"RTN","PXPXRM",153,0)
 Q
"RTN","PXPXRM",154,0)
 ;
"RTN","PXPXRM",155,0)
 ;===============================================================
"RTN","PXPXRM",156,0)
VHF(DA,DATA) ;Return data for a specified V Health Factor entry.
"RTN","PXPXRM",157,0)
 N TEMP
"RTN","PXPXRM",158,0)
 S TEMP=^AUPNVHF(DA,0)
"RTN","PXPXRM",159,0)
 S DATA("VISIT")=$P(TEMP,U,3)
"RTN","PXPXRM",160,0)
 S (DATA("LEVEL/SEVERITY"),DATA("VALUE"))=$P(TEMP,U,4)
"RTN","PXPXRM",161,0)
 S DATA("COMMENTS")=$G(^AUPNVHF(DA,811))
"RTN","PXPXRM",162,0)
 Q
"RTN","PXPXRM",163,0)
 ;
"RTN","PXPXRM",164,0)
 ;===============================================================
"RTN","PXPXRM",165,0)
VIMM(DA,DATA) ;Return data, for a specified V Immunization entry.
"RTN","PXPXRM",166,0)
 N PXCS,PXCSIEN,PXCDIEN,PXCODE,PXFILE,PXIEN,PXTEMP,PXVIMM,PXVISIT
"RTN","PXPXRM",167,0)
 ;
"RTN","PXPXRM",168,0)
 S PXFILE=9000010.11
"RTN","PXPXRM",169,0)
 ;
"RTN","PXPXRM",170,0)
 S PXTEMP=^AUPNVIMM(DA,0)
"RTN","PXPXRM",171,0)
 S PXVIMM=$P(PXTEMP,U)
"RTN","PXPXRM",172,0)
 S PXVISIT=$P(PXTEMP,U,3)
"RTN","PXPXRM",173,0)
 S DATA("VISIT")=PXVISIT
"RTN","PXPXRM",174,0)
 S (DATA("SERIES"),DATA("VALUE"))=$P(PXTEMP,U,4)
"RTN","PXPXRM",175,0)
 S DATA("REACTION")=$P(PXTEMP,U,6)
"RTN","PXPXRM",176,0)
 S DATA("CONTRAINDICATED")=$P(PXTEMP,U,7)
"RTN","PXPXRM",177,0)
 S DATA("COMMENTS")=$G(^AUPNVIMM(DA,811))
"RTN","PXPXRM",178,0)
 ;
"RTN","PXPXRM",179,0)
 S PXTEMP=$G(^AUPNVSIT(+PXVISIT,0))
"RTN","PXPXRM",180,0)
 S DATA("VISIT DATE TIME")=$P(PXTEMP,U)
"RTN","PXPXRM",181,0)
 S DATA("LOCATION")=$$GETFLDS(44,$P(PXTEMP,U,22),".01")
"RTN","PXPXRM",182,0)
 ;
"RTN","PXPXRM",183,0)
 S PXTEMP=$P(PXTEMP,U,6)
"RTN","PXPXRM",184,0)
 S DATA("FACILITY")=PXTEMP_$S(PXTEMP:(U_$$NS^XUAF4(PXTEMP)),1:"")
"RTN","PXPXRM",185,0)
 ;
"RTN","PXPXRM",186,0)
 S PXTEMP=$G(^AUPNVIMM(DA,12))
"RTN","PXPXRM",187,0)
 S DATA("EVENT DATE TIME")=$P(PXTEMP,U)
"RTN","PXPXRM",188,0)
 S DATA("ORDERING PROVIDER")=$$GETFLDS(200,$P(PXTEMP,U,2),".01")
"RTN","PXPXRM",189,0)
 S DATA("ENCOUNTER PROVIDER")=$$GETFLDS(200,$P(PXTEMP,U,4),".01")
"RTN","PXPXRM",190,0)
 S DATA("DATE RECORDED")=$P(PXTEMP,U,5)
"RTN","PXPXRM",191,0)
 S DATA("DOCUMENTER")=$$GETFLDS(200,$P(PXTEMP,U,6),".01")
"RTN","PXPXRM",192,0)
 S DATA("LOT NUMBER")=$$GETFLDS(9999999.41,$P(PXTEMP,U,7),".01")
"RTN","PXPXRM",193,0)
 ;
"RTN","PXPXRM",194,0)
 S PXTEMP=$G(^AUTTIML(+$P(PXTEMP,U,7),0))
"RTN","PXPXRM",195,0)
 S DATA("MANUFACTURER")=$$GETFLDS(9999999.04,$P(PXTEMP,U,2),".01")
"RTN","PXPXRM",196,0)
 S DATA("EXPIRATION DATE")=$P(PXTEMP,U,9)
"RTN","PXPXRM",197,0)
 ;
"RTN","PXPXRM",198,0)
 S PXTEMP=$G(^AUPNVIMM(DA,13))
"RTN","PXPXRM",199,0)
 S DATA("INFO SOURCE")=$$GETFLDS(920.1,$P(PXTEMP,U),".02;.01")
"RTN","PXPXRM",200,0)
 S DATA("ADMIN ROUTE")=$$GETFLDS(920.2,$P(PXTEMP,U,2),".02;.01")
"RTN","PXPXRM",201,0)
 S DATA("ADMIN SITE")=$$GETFLDS(920.3,$P(PXTEMP,U,3),".02;.01")
"RTN","PXPXRM",202,0)
 S DATA("DOSE")=$$GET1^DIQ(PXFILE,DA_",",1312)
"RTN","PXPXRM",203,0)
 S DATA("DOSE UNITS")=$$GET1^DIQ(PXFILE,DA_",",1313)
"RTN","PXPXRM",204,0)
 ;
"RTN","PXPXRM",205,0)
 S DATA("IMMUNIZATION")=$$GETFLDS(9999999.14,PXVIMM,".01")
"RTN","PXPXRM",206,0)
 S DATA("CVX")=$$GET1^DIQ(9999999.14,PXVIMM_",",.03)
"RTN","PXPXRM",207,0)
 S PXIEN=0
"RTN","PXPXRM",208,0)
 F  S PXIEN=$O(^AUTTIMM(PXVIMM,7,PXIEN)) Q:'PXIEN  D
"RTN","PXPXRM",209,0)
 . S PXTEMP=$P($G(^AUTTIMM(PXVIMM,7,PXIEN,0)),U,1)
"RTN","PXPXRM",210,0)
 . I PXTEMP="" Q
"RTN","PXPXRM",211,0)
 . S DATA("VACCINE GROUP",PXIEN,0)=PXTEMP
"RTN","PXPXRM",212,0)
 ;
"RTN","PXPXRM",213,0)
 ;S DATA("CODES",Coding System Name)=Code 1 ^ Code 2 ^ ... Code x
"RTN","PXPXRM",214,0)
 S PXCSIEN=0
"RTN","PXPXRM",215,0)
 F  S PXCSIEN=$O(^AUTTIMM(PXVIMM,3,PXCSIEN)) Q:'PXCSIEN  D
"RTN","PXPXRM",216,0)
 . S PXCS=$P($G(^AUTTIMM(PXVIMM,3,PXCSIEN,0)),U,1)
"RTN","PXPXRM",217,0)
 . I PXCS="" Q
"RTN","PXPXRM",218,0)
 . S PXCDIEN=0
"RTN","PXPXRM",219,0)
 . F  S PXCDIEN=$O(^AUTTIMM(PXVIMM,3,PXCSIEN,1,PXCDIEN)) Q:'PXCDIEN  D
"RTN","PXPXRM",220,0)
 . . S PXCODE=$P($G(^AUTTIMM(PXVIMM,3,PXCSIEN,1,PXCDIEN,0)),U,1)
"RTN","PXPXRM",221,0)
 . . I PXCODE="" Q
"RTN","PXPXRM",222,0)
 . . I '$D(DATA("CODES",PXCS)) S DATA("CODES",PXCS)=PXCODE Q
"RTN","PXPXRM",223,0)
 . . S DATA("CODES",PXCS)=DATA("CODES",PXCS)_U_PXCODE
"RTN","PXPXRM",224,0)
 ;
"RTN","PXPXRM",225,0)
 ;DATA("VIS OFFERED",n,0)=IEN ^ Date Offered ^ Name ^ Edition Date ^ Language
"RTN","PXPXRM",226,0)
 S PXIEN=0
"RTN","PXPXRM",227,0)
 F  S PXIEN=$O(^AUPNVIMM(DA,2,PXIEN)) Q:'PXIEN  D
"RTN","PXPXRM",228,0)
 . S PXTEMP=$G(^AUPNVIMM(DA,2,PXIEN,0))
"RTN","PXPXRM",229,0)
 . I 'PXTEMP Q
"RTN","PXPXRM",230,0)
 . S DATA("VIS OFFERED",PXIEN,0)=$P(PXTEMP,U,1,2)_U_$P($$GETFLDS(920,+PXTEMP,".01;.02~I"),U,2,3)_U_$$GET1^DIQ(920,+PXTEMP_",",".04:1")
"RTN","PXPXRM",231,0)
 ;
"RTN","PXPXRM",232,0)
 ;DATA("REMARKS",n,0)=Free text
"RTN","PXPXRM",233,0)
 M DATA("REMARKS")=^AUPNVIMM(DA,11)
"RTN","PXPXRM",234,0)
 K DATA("REMARKS",0)
"RTN","PXPXRM",235,0)
 ;
"RTN","PXPXRM",236,0)
 Q
"RTN","PXPXRM",237,0)
 ;
"RTN","PXPXRM",238,0)
 ;===============================================================
"RTN","PXPXRM",239,0)
GETFLDS(PXFILE,PXIEN,PXFIELDS) ;Helper function to retrieve data
"RTN","PXPXRM",240,0)
 ;
"RTN","PXPXRM",241,0)
 N PXRESULT,PXIENS,PXSPEC,PXDIQFLDS,PXARR,PXI,PXFLD,PXVALTYP
"RTN","PXPXRM",242,0)
 ;
"RTN","PXPXRM",243,0)
 S PXRESULT=PXIEN
"RTN","PXPXRM",244,0)
 ;
"RTN","PXPXRM",245,0)
 I '$G(PXIEN) Q PXRESULT
"RTN","PXPXRM",246,0)
 S PXIENS=PXIEN_","
"RTN","PXPXRM",247,0)
 S PXSPEC("~I")=""
"RTN","PXPXRM",248,0)
 S PXSPEC("~E")=""
"RTN","PXPXRM",249,0)
 S PXDIQFLDS=$$REPLACE^XLFSTR(PXFIELDS,.PXSPEC)
"RTN","PXPXRM",250,0)
 D GETS^DIQ(PXFILE,PXIENS,PXDIQFLDS,"EI","PXARR")
"RTN","PXPXRM",251,0)
 ;
"RTN","PXPXRM",252,0)
 F PXI=1:1 S PXFLD=$P(PXFIELDS,";",PXI) Q:PXFLD=""  D
"RTN","PXPXRM",253,0)
 . S PXVALTYP=$P(PXFLD,"~",2)
"RTN","PXPXRM",254,0)
 . I PXVALTYP'="I" S PXVALTYP="E"
"RTN","PXPXRM",255,0)
 . S PXFLD=$P(PXFLD,"~",1)
"RTN","PXPXRM",256,0)
 . S PXRESULT=PXRESULT_U_$G(PXARR(PXFILE,PXIENS,PXFLD,PXVALTYP))
"RTN","PXPXRM",257,0)
 ;
"RTN","PXPXRM",258,0)
 Q PXRESULT
"RTN","PXPXRM",259,0)
 ;
"RTN","PXPXRM",260,0)
 ;===============================================================
"RTN","PXPXRM",261,0)
VPEDU(DA,DATA) ;Return data, for a specified V Patient ED entry.
"RTN","PXPXRM",262,0)
 N TEMP
"RTN","PXPXRM",263,0)
 S TEMP=^AUPNVPED(DA,0)
"RTN","PXPXRM",264,0)
 S DATA("VISIT")=$P(TEMP,U,3)
"RTN","PXPXRM",265,0)
 S (DATA("LEVEL OF UNDERSTANDING"),DATA("VALUE"))=$P(TEMP,U,6)
"RTN","PXPXRM",266,0)
 S DATA("COMMENTS")=$G(^AUPNVPED(DA,811))
"RTN","PXPXRM",267,0)
 Q
"RTN","PXPXRM",268,0)
 ;
"RTN","PXPXRM",269,0)
 ;===============================================================
"RTN","PXPXRM",270,0)
VPOV(DA,DATA) ;Return data for a specified V POV entry.
"RTN","PXPXRM",271,0)
 N TEMP
"RTN","PXPXRM",272,0)
 S TEMP=^AUPNVPOV(DA,0)
"RTN","PXPXRM",273,0)
 S DATA("VISIT")=$P(TEMP,U,3)
"RTN","PXPXRM",274,0)
 S DATA("PROVIDER NARRATIVE")=$P(TEMP,U,4)
"RTN","PXPXRM",275,0)
 S DATA("MODIFIER")=$P(TEMP,U,6)
"RTN","PXPXRM",276,0)
 S DATA("PRIMARY/SECONDARY")=$P(TEMP,U,12)
"RTN","PXPXRM",277,0)
 S DATA("DATE OF INJURY")=$P(TEMP,U,13)
"RTN","PXPXRM",278,0)
 S DATA("CLINICAL TERM")=$P(TEMP,U,15)
"RTN","PXPXRM",279,0)
 S DATA("PROBLEM LIST ENTRY")=$P(TEMP,U,16)
"RTN","PXPXRM",280,0)
 S DATA("COMMENTS")=$G(^AUPNVPOV(DA,811))
"RTN","PXPXRM",281,0)
 Q
"RTN","PXPXRM",282,0)
 ;
"RTN","PXPXRM",283,0)
 ;===============================================================
"RTN","PXPXRM",284,0)
VSKIN(DA,DATA) ;Return data for a specified V Skin Test entry.
"RTN","PXPXRM",285,0)
 N TEMP
"RTN","PXPXRM",286,0)
 S TEMP=^AUPNVSK(DA,0)
"RTN","PXPXRM",287,0)
 S DATA("VISIT")=$P(TEMP,U,3)
"RTN","PXPXRM",288,0)
 S (DATA("RESULTS"),DATA("VALUE"))=$P(TEMP,U,4)
"RTN","PXPXRM",289,0)
 S DATA("READING")=$P(TEMP,U,5)
"RTN","PXPXRM",290,0)
 S DATA("DATE READ")=$P(TEMP,U,6)
"RTN","PXPXRM",291,0)
 S DATA("COMMENTS")=$G(^AUPNVSK(DA,811))
"RTN","PXPXRM",292,0)
 Q
"RTN","PXPXRM",293,0)
 ;
"RTN","PXPXRM",294,0)
 ;===============================================================
"RTN","PXPXRM",295,0)
VXAM(DA,DATA) ;Return data, for a specified V Exam entry.
"RTN","PXPXRM",296,0)
 N TEMP
"RTN","PXPXRM",297,0)
 S TEMP=^AUPNVXAM(DA,0)
"RTN","PXPXRM",298,0)
 S DATA("VISIT")=$P(TEMP,U,3)
"RTN","PXPXRM",299,0)
 S (DATA("RESULT"),DATA("VALUE"))=$P(TEMP,U,4)
"RTN","PXPXRM",300,0)
 S DATA("COMMENTS")=$G(^AUPNVXAM(DA,811))
"RTN","PXPXRM",301,0)
 Q
"RTN","PXPXRM",302,0)
 ;
"RTN","PXPXRMI1")
0^13^B55159505^B51661630
"RTN","PXPXRMI1",1,0)
PXPXRMI1 ; SLC/PKR,SCK - Build indexes for the V files. ;07/02/15  09:32
"RTN","PXPXRMI1",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**119,194,210**;Aug 12, 1996;Build 11
"RTN","PXPXRMI1",3,0)
 ;DBIA 4113 supports PXRMSXRM entry points.
"RTN","PXPXRMI1",4,0)
 ;DBIA 4114 supports setting and killing ^PXRMINDX
"RTN","PXPXRMI1",5,0)
 ;===============================================================
"RTN","PXPXRMI1",6,0)
VCPT ;Build the indexes for V CPT.
"RTN","PXPXRMI1",7,0)
 N CPT,DAS,DATE,DFN,DIFF,DONE,END,ENTRIES,ETEXT,GLOBAL,IND,NE,NERROR,PP
"RTN","PXPXRMI1",8,0)
 N START,TEMP,TENP,TEXT,VISIT
"RTN","PXPXRMI1",9,0)
 ;Don't leave any old stuff around.
"RTN","PXPXRMI1",10,0)
 K ^PXRMINDX(9000010.18)
"RTN","PXPXRMI1",11,0)
 S GLOBAL=$$GET1^DID(9000010.18,"","","GLOBAL NAME")
"RTN","PXPXRMI1",12,0)
 S ENTRIES=$P(^AUPNVCPT(0),U,4)
"RTN","PXPXRMI1",13,0)
 S TENP=ENTRIES/10
"RTN","PXPXRMI1",14,0)
 S TENP=+$P(TENP,".",1)
"RTN","PXPXRMI1",15,0)
 I TENP<1 S TENP=1
"RTN","PXPXRMI1",16,0)
 D BMES^XPDUTL("Building indexes for V CPT")
"RTN","PXPXRMI1",17,0)
 S TEXT="There are "_ENTRIES_" entries to process."
"RTN","PXPXRMI1",18,0)
 D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",19,0)
 S START=$H
"RTN","PXPXRMI1",20,0)
 S (DAS,DONE,IND,NE,NERROR)=0
"RTN","PXPXRMI1",21,0)
 F  S DAS=$O(^AUPNVCPT(DAS)) Q:DONE  D
"RTN","PXPXRMI1",22,0)
 . I +DAS=0 S DONE=1 Q
"RTN","PXPXRMI1",23,0)
 . I +DAS'=DAS D  Q
"RTN","PXPXRMI1",24,0)
 .. S DONE=1
"RTN","PXPXRMI1",25,0)
 .. S ETEXT="Bad ien: "_DAS_", cannot continue."
"RTN","PXPXRMI1",26,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",27,0)
 . S IND=IND+1
"RTN","PXPXRMI1",28,0)
 . I IND#TENP=0 D
"RTN","PXPXRMI1",29,0)
 .. S TEXT="Processing entry "_IND
"RTN","PXPXRMI1",30,0)
 .. D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",31,0)
 . I IND#10000=0 W "."
"RTN","PXPXRMI1",32,0)
 . S TEMP=^AUPNVCPT(DAS,0)
"RTN","PXPXRMI1",33,0)
 . S CPT=$P(TEMP,U,1)
"RTN","PXPXRMI1",34,0)
 . I CPT="" D  Q
"RTN","PXPXRMI1",35,0)
 .. S ETEXT=DAS_" missing CPT"
"RTN","PXPXRMI1",36,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",37,0)
 . ;I '$D(^ICPT(CPT)) D  Q
"RTN","PXPXRMI1",38,0)
 . I $$CPT^ICPTCOD(CPT)<0 D  Q
"RTN","PXPXRMI1",39,0)
 .. S ETEXT=DAS_" invalid CPT"
"RTN","PXPXRMI1",40,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",41,0)
 . S DFN=$P(TEMP,U,2)
"RTN","PXPXRMI1",42,0)
 . I DFN="" D  Q
"RTN","PXPXRMI1",43,0)
 .. S ETEXT=DAS_" missing DFN"
"RTN","PXPXRMI1",44,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",45,0)
 . S VISIT=$P(TEMP,U,3)
"RTN","PXPXRMI1",46,0)
 . I VISIT="" D  Q
"RTN","PXPXRMI1",47,0)
 .. S ETEXT=DAS_" missing visit"
"RTN","PXPXRMI1",48,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",49,0)
 . I '$D(^AUPNVSIT(VISIT)) D  Q
"RTN","PXPXRMI1",50,0)
 .. S ETEXT=DAS_" invalid visit"
"RTN","PXPXRMI1",51,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",52,0)
 . S DATE=$P(^AUPNVSIT(VISIT,0),U,1)
"RTN","PXPXRMI1",53,0)
 . I DATE="" D  Q
"RTN","PXPXRMI1",54,0)
 .. S ETEXT=DAS_" missing visit date"
"RTN","PXPXRMI1",55,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",56,0)
 . S PP=$P(TEMP,U,7)
"RTN","PXPXRMI1",57,0)
 . I PP="" S PP="U"
"RTN","PXPXRMI1",58,0)
 . S NE=NE+1
"RTN","PXPXRMI1",59,0)
 . S ^PXRMINDX(9000010.18,"IPP",CPT,PP,DFN,DATE,DAS)=""
"RTN","PXPXRMI1",60,0)
 . S ^PXRMINDX(9000010.18,"PPI",DFN,PP,CPT,DATE,DAS)=""
"RTN","PXPXRMI1",61,0)
 S END=$H
"RTN","PXPXRMI1",62,0)
 S TEXT=NE_" V CPT results indexed."
"RTN","PXPXRMI1",63,0)
 D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",64,0)
 D DETIME^PXRMSXRM(START,END)
"RTN","PXPXRMI1",65,0)
 ;If there were errors send a message.
"RTN","PXPXRMI1",66,0)
 I NERROR>0 D ERRMSG^PXRMSXRM(NERROR,GLOBAL)
"RTN","PXPXRMI1",67,0)
 ;Send a MailMan message with the results.
"RTN","PXPXRMI1",68,0)
 D COMMSG^PXRMSXRM(GLOBAL,START,END,NE,NERROR)
"RTN","PXPXRMI1",69,0)
 S ^PXRMINDX(9000010.18,"GLOBAL NAME")=GLOBAL
"RTN","PXPXRMI1",70,0)
 S ^PXRMINDX(9000010.18,"BUILT BY")=DUZ
"RTN","PXPXRMI1",71,0)
 S ^PXRMINDX(9000010.18,"DATE BUILT")=$$NOW^XLFDT
"RTN","PXPXRMI1",72,0)
 Q
"RTN","PXPXRMI1",73,0)
 ;
"RTN","PXPXRMI1",74,0)
 ;===============================================================
"RTN","PXPXRMI1",75,0)
VHF ;Build the indexes for V HEALTH FACTORS.
"RTN","PXPXRMI1",76,0)
 N CAT,DAS,DATE,DFN,DIFF,DONE,END,ENTRIES,ETEXT,GLOBAL,HF,IND,NE,NERROR
"RTN","PXPXRMI1",77,0)
 N START,TEMP,TENP,TEXT,VISIT
"RTN","PXPXRMI1",78,0)
 ;Don't leave any old stuff around.
"RTN","PXPXRMI1",79,0)
 K ^PXRMINDX(9000010.23)
"RTN","PXPXRMI1",80,0)
 S GLOBAL=$$GET1^DID(9000010.23,"","","GLOBAL NAME")
"RTN","PXPXRMI1",81,0)
 S ENTRIES=$P(^AUPNVHF(0),U,4)
"RTN","PXPXRMI1",82,0)
 S TENP=ENTRIES/10
"RTN","PXPXRMI1",83,0)
 S TENP=+$P(TENP,".",1)
"RTN","PXPXRMI1",84,0)
 I TENP<1 S TENP=1
"RTN","PXPXRMI1",85,0)
 D BMES^XPDUTL("Building indexes for V HEALTH FACTORS")
"RTN","PXPXRMI1",86,0)
 S TEXT="There are "_ENTRIES_" entries to process."
"RTN","PXPXRMI1",87,0)
 D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",88,0)
 S START=$H
"RTN","PXPXRMI1",89,0)
 S (DAS,DONE,IND,NE,NERROR)=0
"RTN","PXPXRMI1",90,0)
 F  S DAS=$O(^AUPNVHF(DAS)) Q:DONE  D
"RTN","PXPXRMI1",91,0)
 . I +DAS=0 S DONE=1 Q
"RTN","PXPXRMI1",92,0)
 . I +DAS'=DAS D  Q
"RTN","PXPXRMI1",93,0)
 .. S DONE=1
"RTN","PXPXRMI1",94,0)
 .. S ETEXT="Bad ien: "_DAS_", cannot continue."
"RTN","PXPXRMI1",95,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",96,0)
 . S IND=IND+1
"RTN","PXPXRMI1",97,0)
 . I IND#TENP=0 D
"RTN","PXPXRMI1",98,0)
 .. S TEXT="Processing entry "_IND
"RTN","PXPXRMI1",99,0)
 .. D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",100,0)
 . I IND#10000=0 W "."
"RTN","PXPXRMI1",101,0)
 . S TEMP=^AUPNVHF(DAS,0)
"RTN","PXPXRMI1",102,0)
 . S HF=$P(TEMP,U,1)
"RTN","PXPXRMI1",103,0)
 . I HF="" D  Q
"RTN","PXPXRMI1",104,0)
 .. S ETEXT=DAS_" missing HF"
"RTN","PXPXRMI1",105,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",106,0)
 . I '$D(^AUTTHF(HF)) D  Q
"RTN","PXPXRMI1",107,0)
 .. S ETEXT=DAS_" invalid HF"
"RTN","PXPXRMI1",108,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",109,0)
 . S DFN=$P(TEMP,U,2)
"RTN","PXPXRMI1",110,0)
 . I DFN="" D  Q
"RTN","PXPXRMI1",111,0)
 .. S ETEXT=DAS_" missing DFN"
"RTN","PXPXRMI1",112,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",113,0)
 . S CAT=$P(^AUTTHF(HF,0),U,3)
"RTN","PXPXRMI1",114,0)
 . I CAT="" D  Q
"RTN","PXPXRMI1",115,0)
 .. S ETEXT=DAS_" HF "_HF_" missing category"
"RTN","PXPXRMI1",116,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",117,0)
 . I HF=CAT D  Q
"RTN","PXPXRMI1",118,0)
 .. S ETEXT=DAS_" HF "_HF_" is a category"
"RTN","PXPXRMI1",119,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",120,0)
 . S VISIT=$P(TEMP,U,3)
"RTN","PXPXRMI1",121,0)
 . I VISIT="" D  Q
"RTN","PXPXRMI1",122,0)
 .. S ETEXT=DAS_" missing visit"
"RTN","PXPXRMI1",123,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",124,0)
 . I '$D(^AUPNVSIT(VISIT)) D  Q
"RTN","PXPXRMI1",125,0)
 .. S ETEXT=DAS_" invalid visit"
"RTN","PXPXRMI1",126,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",127,0)
 . S DATE=$P(^AUPNVSIT(VISIT,0),U,1)
"RTN","PXPXRMI1",128,0)
 . I DATE="" D  Q
"RTN","PXPXRMI1",129,0)
 .. S ETEXT=DAS_" missing visit date"
"RTN","PXPXRMI1",130,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",131,0)
 . S NE=NE+1
"RTN","PXPXRMI1",132,0)
 . S ^PXRMINDX(9000010.23,"IP",HF,DFN,DATE,DAS)=""
"RTN","PXPXRMI1",133,0)
 . S ^PXRMINDX(9000010.23,"PI",DFN,HF,DATE,DAS)=""
"RTN","PXPXRMI1",134,0)
 S END=$H
"RTN","PXPXRMI1",135,0)
 S TEXT=NE_" V HEALTH FACTOR results indexed."
"RTN","PXPXRMI1",136,0)
 D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",137,0)
 D DETIME^PXRMSXRM(START,END)
"RTN","PXPXRMI1",138,0)
 ;If there were errors send a message.
"RTN","PXPXRMI1",139,0)
 I NERROR>0 D ERRMSG^PXRMSXRM(NERROR,GLOBAL)
"RTN","PXPXRMI1",140,0)
 ;Send a MailMan message with the results.
"RTN","PXPXRMI1",141,0)
 D COMMSG^PXRMSXRM(GLOBAL,START,END,NE,NERROR)
"RTN","PXPXRMI1",142,0)
 S ^PXRMINDX(9000010.23,"GLOBAL NAME")=GLOBAL
"RTN","PXPXRMI1",143,0)
 S ^PXRMINDX(9000010.23,"BUILT BY")=DUZ
"RTN","PXPXRMI1",144,0)
 S ^PXRMINDX(9000010.23,"DATE BUILT")=$$NOW^XLFDT
"RTN","PXPXRMI1",145,0)
 Q
"RTN","PXPXRMI1",146,0)
 ;
"RTN","PXPXRMI1",147,0)
 ;===============================================================
"RTN","PXPXRMI1",148,0)
VIMM ;Build the indexes for V IMMUNIZATION.
"RTN","PXPXRMI1",149,0)
 N CVX,DAS,DATE,DFN,DIFF,DONE,END,ENTRIES,ETEXT,EVENTDT,GLOBAL,IMM
"RTN","PXPXRMI1",150,0)
 N IND,NE,NERROR,START,TEMP,TENP,TEXT,VISIT
"RTN","PXPXRMI1",151,0)
 ;Don't leave any old stuff around.
"RTN","PXPXRMI1",152,0)
 K ^PXRMINDX(9000010.11)
"RTN","PXPXRMI1",153,0)
 S GLOBAL=$$GET1^DID(9000010.11,"","","GLOBAL NAME")
"RTN","PXPXRMI1",154,0)
 S ENTRIES=$P(^AUPNVIMM(0),U,4)
"RTN","PXPXRMI1",155,0)
 S TENP=ENTRIES/10
"RTN","PXPXRMI1",156,0)
 S TENP=+$P(TENP,".",1)
"RTN","PXPXRMI1",157,0)
 I TENP<1 S TENP=1
"RTN","PXPXRMI1",158,0)
 D BMES^XPDUTL("Building indexes for V IMMUNIZATION")
"RTN","PXPXRMI1",159,0)
 S TEXT="There are "_ENTRIES_" entries to process."
"RTN","PXPXRMI1",160,0)
 D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",161,0)
 S START=$H
"RTN","PXPXRMI1",162,0)
 S (DAS,DONE,IND,NE,NERROR)=0
"RTN","PXPXRMI1",163,0)
 F  S DAS=$O(^AUPNVIMM(DAS)) Q:DONE  D
"RTN","PXPXRMI1",164,0)
 . I +DAS=0 S DONE=1 Q
"RTN","PXPXRMI1",165,0)
 . I +DAS'=DAS D  Q
"RTN","PXPXRMI1",166,0)
 .. S DONE=1
"RTN","PXPXRMI1",167,0)
 .. S ETEXT="Bad ien: "_DAS_", cannot continue."
"RTN","PXPXRMI1",168,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",169,0)
 . S IND=IND+1
"RTN","PXPXRMI1",170,0)
 . I IND#TENP=0 D
"RTN","PXPXRMI1",171,0)
 .. S TEXT="Processing entry "_IND
"RTN","PXPXRMI1",172,0)
 .. D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",173,0)
 . I IND#10000=0 W "."
"RTN","PXPXRMI1",174,0)
 . S TEMP=^AUPNVIMM(DAS,0)
"RTN","PXPXRMI1",175,0)
 . S IMM=$P(TEMP,U,1)
"RTN","PXPXRMI1",176,0)
 . I IMM="" D  Q
"RTN","PXPXRMI1",177,0)
 .. S ETEXT=DAS_" missing immunization"
"RTN","PXPXRMI1",178,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",179,0)
 . I '$D(^AUTTIMM(IMM)) D  Q
"RTN","PXPXRMI1",180,0)
 .. S ETEXT=DAS_" invalid immunization"
"RTN","PXPXRMI1",181,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",182,0)
 . S DFN=$P(TEMP,U,2)
"RTN","PXPXRMI1",183,0)
 . I DFN="" D  Q
"RTN","PXPXRMI1",184,0)
 .. S ETEXT=DAS_" missing DFN"
"RTN","PXPXRMI1",185,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",186,0)
 . S VISIT=$P(TEMP,U,3)
"RTN","PXPXRMI1",187,0)
 . I VISIT="" D  Q
"RTN","PXPXRMI1",188,0)
 .. S ETEXT=DAS_" missing visit"
"RTN","PXPXRMI1",189,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",190,0)
 . I '$D(^AUPNVSIT(VISIT)) D  Q
"RTN","PXPXRMI1",191,0)
 .. S ETEXT=DAS_" invalid visit"
"RTN","PXPXRMI1",192,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",193,0)
 . S DATE=$P(^AUPNVSIT(VISIT,0),U,1)
"RTN","PXPXRMI1",194,0)
 . I DATE="" D  Q
"RTN","PXPXRMI1",195,0)
 .. S ETEXT=DAS_" missing visit date"
"RTN","PXPXRMI1",196,0)
 .. D ADDERROR^PXRMSXRM(GLOBAL,ETEXT,.NERROR)
"RTN","PXPXRMI1",197,0)
 . S EVENTDT=$P($G(^AUPNVIMM(DAS,12)),U,1)
"RTN","PXPXRMI1",198,0)
 . I EVENTDT S DATE=EVENTDT
"RTN","PXPXRMI1",199,0)
 . S NE=NE+1
"RTN","PXPXRMI1",200,0)
 . S ^PXRMINDX(9000010.11,"IP",IMM,DFN,DATE,DAS)=""
"RTN","PXPXRMI1",201,0)
 . S ^PXRMINDX(9000010.11,"PI",DFN,IMM,DATE,DAS)=""
"RTN","PXPXRMI1",202,0)
 . S CVX=$P($G(^AUTTIMM(IMM,0)),U,3)
"RTN","PXPXRMI1",203,0)
 . I CVX'="" D
"RTN","PXPXRMI1",204,0)
 .. S ^PXRMINDX(9000010.11,"CVX","IP",CVX,DFN,DATE,DAS)=""
"RTN","PXPXRMI1",205,0)
 .. S ^PXRMINDX(9000010.11,"CVX","PI",DFN,CVX,DATE,DAS)=""
"RTN","PXPXRMI1",206,0)
 S END=$H
"RTN","PXPXRMI1",207,0)
 S TEXT=NE_" V IMMUNIZATION results indexed."
"RTN","PXPXRMI1",208,0)
 D MES^XPDUTL(TEXT)
"RTN","PXPXRMI1",209,0)
 D DETIME^PXRMSXRM(START,END)
"RTN","PXPXRMI1",210,0)
 ;If there were errors send a message.
"RTN","PXPXRMI1",211,0)
 I NERROR>0 D ERRMSG^PXRMSXRM(NERROR,GLOBAL)
"RTN","PXPXRMI1",212,0)
 ;Send a MailMan message with the results.
"RTN","PXPXRMI1",213,0)
 D COMMSG^PXRMSXRM(GLOBAL,START,END,NE,NERROR)
"RTN","PXPXRMI1",214,0)
 S ^PXRMINDX(9000010.11,"GLOBAL NAME")=GLOBAL
"RTN","PXPXRMI1",215,0)
 S ^PXRMINDX(9000010.11,"BUILT BY")=DUZ
"RTN","PXPXRMI1",216,0)
 S ^PXRMINDX(9000010.11,"DATE BUILT")=$$NOW^XLFDT
"RTN","PXPXRMI1",217,0)
 Q
"RTN","PXPXRMI1",218,0)
 ;
"RTN","PXRHS03")
0^9^B30812886^B10262862
"RTN","PXRHS03",1,0)
PXRHS03 ; SLC/SBW - PCE Visit data immunization extract ;08/19/15  17:43
"RTN","PXRHS03",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**13,210**;Aug 12, 1996;Build 11
"RTN","PXRHS03",3,0)
IMMUN(DFN,PXFG) ; Control branching
"RTN","PXRHS03",4,0)
 ;INPUT  : DFN      - Pointer to PATIENT file (#2)
"RTN","PXRHS03",5,0)
 ;       : PXFG     - Primary sort order
"RTN","PXRHS03",6,0)
 ;                    "A": Alphabetical  (IM, DIM, SIM)
"RTN","PXRHS03",7,0)
 ;                    "C": Chronological  (SIMC)
"RTN","PXRHS03",8,0)
 ;                    "R": Reverse Chronological (SIMR)
"RTN","PXRHS03",9,0)
 ;OUTPUT : 
"RTN","PXRHS03",10,0)
 ;  Data from V Immunization (9000010.11) file
"RTN","PXRHS03",11,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,0) = IMMUNIZATION [E;.01]
"RTN","PXRHS03",12,0)
 ;     ^ IMMUNIZATION SHORT NAME [E;9999999.14,.02]
"RTN","PXRHS03",13,0)
 ;     ^ EVENT DATE/TIME or VISIT/ADMIT DATE&TIME [I;1201 or .03] 
"RTN","PXRHS03",14,0)
 ;     ^ SERIES CODE [I;.04] ^ SERIES [E;.04] ^ REACTION [E;.06]
"RTN","PXRHS03",15,0)
 ;     ^ CONTRAINDICATED [I;.07] ^ ORDERING PROVIDER [E;1202]
"RTN","PXRHS03",16,0)
 ;     ^ ENCOUNTER PROVIDER [E;1204]
"RTN","PXRHS03",17,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,1) = ^ HOSPITAL LOCATION [E;9000010;.22]
"RTN","PXRHS03",18,0)
 ;     ^ HOSP. LOC. ABBREVIATION [E;44;1]
"RTN","PXRHS03",19,0)
 ;     ^ LOC OF ENCOUNTER [E;9000010;.06] ^ OUTSIDE LOC [E;9000010;2101]
"RTN","PXRHS03",20,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,2) = ROUTE OF ADMIN [E;1302] 
"RTN","PXRHS03",21,0)
 ;     ^ SITE OF ADMIN [E;1303] ^ DOSAGE [E;1312.5]
"RTN","PXRHS03",22,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,3) = LOT [E;.05] ^ MANUF [E;9999999.41;.02]
"RTN","PXRHS03",23,0)
 ;     ^ EXP DATE [I;9999999.41;.09]
"RTN","PXRHS03",24,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,"FN") = CDC FULL VACCINE NAME [E;9999999.14;2]
"RTN","PXRHS03",25,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,"R",CNT) = REMARKS [E;1101]
"RTN","PXRHS03",26,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,"S") = DATA SOURCE [E;80102]
"RTN","PXRHS03",27,0)
 ;  ^TMP("PXI",$J,PXSORT,PXSORT2,IFN,"VIS") = VIS OFFERED TO PATIENT [E;2] 
"RTN","PXRHS03",28,0)
 ;     ^ EDITION DATE [I;920;.02]
"RTN","PXRHS03",29,0)
 ;
"RTN","PXRHS03",30,0)
 ;   [] = [I(nternal)/E(xternal); Optional file #; Record #]
"RTN","PXRHS03",31,0)
 ;   Subscripts:
"RTN","PXRHS03",32,0)
 ;     PXSORT   - Immunization name (IM, DIM) OR
"RTN","PXRHS03",33,0)
 ;                Fileman date of DATE OF event or visit (SIMC) OR
"RTN","PXRHS03",34,0)
 ;                Inverse Fileman date of DATE OF event or visit (SIM, SIMR)
"RTN","PXRHS03",35,0)
 ;     PXSORT2  - Immunization name (SIM, SIMC, SIMR)
"RTN","PXRHS03",36,0)
 ;     IFN   - Internal Record #
"RTN","PXRHS03",37,0)
 ;
"RTN","PXRHS03",38,0)
 Q:$G(DFN)']""!'$D(^AUPNVIMM("AA",DFN))
"RTN","PXRHS03",39,0)
 N PXIMM,PXIVD,PXIFN,IHSDATE
"RTN","PXRHS03",40,0)
 N PXVLST,PXVIEN,PXSORT,PXSORT2,PXVCNT,GMTSMX
"RTN","PXRHS03",41,0)
 S GMTSMX=999 I $D(GMTSNDM),(GMTSNDM>0) S GMTSMX=GMTSNDM
"RTN","PXRHS03",42,0)
 S IHSDATE=9999999-$$HSDATE^PXRHS01
"RTN","PXRHS03",43,0)
 ; if selected records are requested, get IENs and store in a list
"RTN","PXRHS03",44,0)
 I $G(GMTSEGN),$D(GMTSEG(GMTSEGN,9999999.14)) S PXVIEN=0 F  S PXVIEN=$O(GMTSEG(GMTSEGN,9999999.14,PXVIEN)) Q:PXVIEN=""  D
"RTN","PXRHS03",45,0)
 . S PXVLST(GMTSEG(GMTSEGN,9999999.14,PXVIEN))=""
"RTN","PXRHS03",46,0)
 K ^TMP("PXI",$J)
"RTN","PXRHS03",47,0)
 I '$D(PXFG) S PXFG="A"
"RTN","PXRHS03",48,0)
 S PXIMM=""
"RTN","PXRHS03",49,0)
 F  S PXIMM=$O(^AUPNVIMM("AA",DFN,PXIMM)) Q:PXIMM=""  D
"RTN","PXRHS03",50,0)
 . I $G(GMTSEGN),$D(GMTSEG(GMTSEGN,9999999.14)) Q:'$D(PXVLST(PXIMM))
"RTN","PXRHS03",51,0)
 . S PXIVD=0
"RTN","PXRHS03",52,0)
 . F  S PXIVD=$O(^AUPNVIMM("AA",DFN,PXIMM,PXIVD)) Q:PXIVD'>0  Q:PXIVD>IHSDATE  D
"RTN","PXRHS03",53,0)
 . . S PXIFN=0
"RTN","PXRHS03",54,0)
 . . F  S PXIFN=$O(^AUPNVIMM("AA",DFN,PXIMM,PXIVD,PXIFN)) Q:PXIFN'>0  D
"RTN","PXRHS03",55,0)
 . . . S PXVCNT(PXIMM)=$S('$D(PXVCNT(PXIMM)):1,1:PXVCNT(PXIMM)+1)
"RTN","PXRHS03",56,0)
 . . . ;check time limits and occurence limits
"RTN","PXRHS03",57,0)
 . . . I $G(GMTSBEG) Q:PXIVD>(9999999-(GMTSBEG\1))!(PXVCNT(PXIMM)>GMTSMX)
"RTN","PXRHS03",58,0)
 . . . N DIC,DIQ,DR,DA,REC,IMM,SNIMM,IMDT,SERIESC,SERIES,REACT,CONT
"RTN","PXRHS03",59,0)
 . . . N OPROV,EPROV,HLOC,HLOCABB,SOURCE,VDATA,IDT,COMMENT
"RTN","PXRHS03",60,0)
 . . . N PXVROUTE,PXVBODY,PXVDOSE,PXVARRAY,PXVC,PXVDATA
"RTN","PXRHS03",61,0)
 . . . S DIC=9000010.11,DA=PXIFN,DIQ="REC(",DIQ(0)="IE"
"RTN","PXRHS03",62,0)
 . . . S DR=".01;.03;.04;.06;.07;1201;1202;1204;1207;80102;81101;1302;1303;1312.5"
"RTN","PXRHS03",63,0)
 . . . D EN^DIQ1
"RTN","PXRHS03",64,0)
 . . . I '$D(REC) S PXVCNT(PXIMM)=PXVCNT(PXIMM)-1 Q
"RTN","PXRHS03",65,0)
 . . . S PXVDATA=$S('+REC(9000010.11,DA,1207,"I"):"",1:$$GETMDATA(+REC(9000010.11,DA,1207,"I")))  ;manuf,lot #,exp dt
"RTN","PXRHS03",66,0)
 . . . S VDATA=$$GETVDATA(+REC(9000010.11,DA,.03,"I"))
"RTN","PXRHS03",67,0)
 . . . K PXVARRAY D GETVIS(DA,.PXVARRAY)
"RTN","PXRHS03",68,0)
 . . . S SNIMM=$P($G(^AUTTIMM(REC(9000010.11,DA,.01,"I"),0)),U,2)
"RTN","PXRHS03",69,0)
 . . . S IMM=REC(9000010.11,DA,.01,"E")
"RTN","PXRHS03",70,0)
 . . . S IMDT=REC(9000010.11,DA,1201,"I")
"RTN","PXRHS03",71,0)
 . . . S:IMDT']"" IMDT=$P(VDATA,U)
"RTN","PXRHS03",72,0)
 . . . S IDT=$S($G(PXFG)="C":IMDT,1:9999999-(IMDT\1)) ;set date as chron or reverse chron
"RTN","PXRHS03",73,0)
 . . . S PXSORT=$S($G(PXFG)="A":IMM,1:IDT\1)  ; primary sort subscript
"RTN","PXRHS03",74,0)
 . . . S PXSORT2=$S($G(PXFG)="A":IDT\1,1:IMM)  ; secondary sort subscript
"RTN","PXRHS03",75,0)
 . . . S SERIESC=REC(9000010.11,DA,.04,"I")
"RTN","PXRHS03",76,0)
 . . . S SERIES=REC(9000010.11,DA,.04,"E")
"RTN","PXRHS03",77,0)
 . . . S REACT=REC(9000010.11,DA,.06,"E")
"RTN","PXRHS03",78,0)
 . . . S CONT=REC(9000010.11,DA,.07,"I")
"RTN","PXRHS03",79,0)
 . . . S OPROV=REC(9000010.11,DA,1202,"E")
"RTN","PXRHS03",80,0)
 . . . S EPROV=REC(9000010.11,DA,1204,"E")
"RTN","PXRHS03",81,0)
 . . . I +REC(9000010.11,DA,1302,"I") S PXVROUTE=REC(9000010.11,DA,1302,"E")  ;admin route
"RTN","PXRHS03",82,0)
 . . . S PXVBODY=REC(9000010.11,DA,1303,"E")  ;admin site
"RTN","PXRHS03",83,0)
 . . . S PXVDOSE=REC(9000010.11,DA,1312.5,"E")  ;dose
"RTN","PXRHS03",84,0)
 . . . S HLOC=$P(VDATA,U,5)
"RTN","PXRHS03",85,0)
 . . . S HLOCABB=$P(VDATA,U,6)
"RTN","PXRHS03",86,0)
 . . . S SOURCE=REC(9000010.11,DA,80102,"E")
"RTN","PXRHS03",87,0)
 . . . S COMMENT=REC(9000010.11,DA,81101,"E")
"RTN","PXRHS03",88,0)
 . . . S ^TMP("PXI",$J,PXSORT,PXSORT2,DA,0)=IMM_U_SNIMM_U_IMDT_U_SERIESC_U_SERIES_U_REACT_U_CONT_U_OPROV_U_EPROV
"RTN","PXRHS03",89,0)
 . . . S ^TMP("PXI",$J,PXSORT,PXSORT2,DA,1)=HLOC_U_HLOCABB_U_$P(VDATA,U,2)_U_$P(VDATA,U,4)
"RTN","PXRHS03",90,0)
 . . . S ^TMP("PXI",$J,PXSORT,PXSORT2,DA,2)=$G(PXVROUTE)_U_PXVBODY_U_PXVDOSE  ;new
"RTN","PXRHS03",91,0)
 . . . S ^TMP("PXI",$J,PXSORT,PXSORT2,DA,3)=PXVDATA  ;new
"RTN","PXRHS03",92,0)
 . . . S ^TMP("PXI",$J,PXSORT,PXSORT2,DA,"S")=SOURCE
"RTN","PXRHS03",93,0)
 . . . S ^TMP("PXI",$J,PXSORT,PXSORT2,DA,"COM")=COMMENT
"RTN","PXRHS03",94,0)
 . . . M ^TMP("PXI",$J,PXSORT,PXSORT2,DA,"VIS")=PXVARRAY(920)  ;new VIS array
"RTN","PXRHS03",95,0)
 . . . S PXVC=0 F  S PXVC=$O(^AUTTIMM(PXIMM,2,PXVC)) Q:PXVC'>0  D
"RTN","PXRHS03",96,0)
 . . . . S ^TMP("PXI",$J,PXSORT,PXSORT2,DA,"FN",PXVC)=$G(^AUTTIMM(PXIMM,2,PXVC,0))  ;new full name
"RTN","PXRHS03",97,0)
 . . . D GETREM(PXSORT,PXSORT2,DA)  ;in original not used
"RTN","PXRHS03",98,0)
 Q
"RTN","PXRHS03",99,0)
GETREM(PXSORT,PXSORT2,RNUM) ;Get the remark data
"RTN","PXRHS03",100,0)
 N CNT
"RTN","PXRHS03",101,0)
 S CNT=0
"RTN","PXRHS03",102,0)
 F  S CNT=$O(^AUPNVIMM(RNUM,11,CNT)) Q:CNT'>0  D
"RTN","PXRHS03",103,0)
 . S ^TMP("PXI",$J,PXSORT,PXSORT2,RNUM,"R",CNT)=$G(^AUPNVIMM(RNUM,11,CNT,0))
"RTN","PXRHS03",104,0)
 Q
"RTN","PXRHS03",105,0)
GETVDATA(DA) ;Get location of encounter and outside location from visit file
"RTN","PXRHS03",106,0)
 N DIC,DIQ,DR,VREC,HLOC,HLOCABB
"RTN","PXRHS03",107,0)
 S DIC=9000010,DIQ="VREC(",DIQ(0)="IE"
"RTN","PXRHS03",108,0)
 S DR=".01;.06;.07;.22;2101"
"RTN","PXRHS03",109,0)
 D EN^DIQ1
"RTN","PXRHS03",110,0)
 S HLOC=VREC(9000010,DA,.22,"E")
"RTN","PXRHS03",111,0)
 S HLOCABB=$$GETHLOC^PXRHS02(+VREC(9000010,DA,.22,"I"))
"RTN","PXRHS03",112,0)
 Q VREC(9000010,DA,.01,"I")_U_VREC(9000010,DA,.06,"E")_U_VREC(9000010,DA,.07,"I")_U_VREC(9000010,DA,2101,"E")_U_HLOC_U_HLOCABB
"RTN","PXRHS03",113,0)
 ;
"RTN","PXRHS03",114,0)
GETMDATA(DA)  ;Get Manufacturer, lot number and expiration date
"RTN","PXRHS03",115,0)
 ;   Input   DA       ien of IMMUNIZATION LOT
"RTN","PXRHS03",116,0)
 ;   Output  MREC     LOT NUMBER^MANUFACTURER^EXPIRATION DATE
"RTN","PXRHS03",117,0)
 N DIC,DR,MREC,DIQ
"RTN","PXRHS03",118,0)
 S DIQ="MREC",DIQ(0)="IE"
"RTN","PXRHS03",119,0)
 S DIC=9999999.41,DR=".01;.02;.09"
"RTN","PXRHS03",120,0)
 D EN^DIQ1
"RTN","PXRHS03",121,0)
 Q MREC(9999999.41,DA,.01,"E")_U_MREC(9999999.41,DA,.02,"E")_U_MREC(9999999.41,DA,.09,"I")
"RTN","PXRHS03",122,0)
 ;
"RTN","PXRHS03",123,0)
GETVIS(PXVI,PXVARRAY) ;Get multiple VIS with edition date
"RTN","PXRHS03",124,0)
 ;  Input   PXVI      ien of IMMUNIZATION record
"RTN","PXRHS03",125,0)
 ;  Output  PXVARRAY  array of VIS names ^ edition dates
"RTN","PXRHS03",126,0)
 N DIC,DR,PXVIEN,DA,DIQ,SREC
"RTN","PXRHS03",127,0)
 S PXVIEN="",DIQ="SREC",DIQ(0)="IE"
"RTN","PXRHS03",128,0)
 F  S PXVIEN=$O(^AUPNVIMM(PXVI,2,"B",PXVIEN)) Q:PXVIEN=""  D
"RTN","PXRHS03",129,0)
 . S DIC=920,DR=".01;.02",DA=+PXVIEN
"RTN","PXRHS03",130,0)
 . D EN^DIQ1
"RTN","PXRHS03",131,0)
 . S PXVARRAY(920,PXVIEN)=SREC(920,PXVIEN,.01,"E")_U_SREC(920,PXVIEN,.02,"I")
"RTN","PXRHS03",132,0)
 Q
"RTN","PXRHS03",133,0)
 ;
"RTN","PXRPC")
0^24^B108100754^B39810837
"RTN","PXRPC",1,0)
PXRPC ;ISL/JLC - PCE DATA2PCE RPC ;08/24/15  18:44
"RTN","PXRPC",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**200,209,210**;Aug 12, 1996;Build 11
"RTN","PXRPC",3,0)
 ;
"RTN","PXRPC",4,0)
 ;
"RTN","PXRPC",5,0)
 ;
"RTN","PXRPC",6,0)
SAVE(OK,PCELIST,LOC,PKGNAME,SRC) ; save PCE information
"RTN","PXRPC",7,0)
 N VSTR
"RTN","PXRPC",8,0)
 I '$D(PCELIST(1)) S OK=-3 Q
"RTN","PXRPC",9,0)
 S VSTR=$P(PCELIST(1),U,4) K ^TMP("PXRPC",$J,VSTR)
"RTN","PXRPC",10,0)
 I $G(PKGNAME)="" S OK=-3 Q
"RTN","PXRPC",11,0)
 I $G(SRC)="" S OK=-3 Q
"RTN","PXRPC",12,0)
 M ^TMP("PXRPC",$J,VSTR)=PCELIST
"RTN","PXRPC",13,0)
DQSAVE ;
"RTN","PXRPC",14,0)
 N PKG,TYP,CODE,IEN,I,X,PXAPI,PXDEL,ERROR
"RTN","PXRPC",15,0)
 N CAT,NARR,ROOT,ROOT2,PXAVST,LEXIEN
"RTN","PXRPC",16,0)
 N PRV,CPT,ICD,IMM,SK,PED,HF,XAM,TRT,MOD,MODCNT,MODIDX,MODS
"RTN","PXRPC",17,0)
 N COM,COMMENT,COMMENTS
"RTN","PXRPC",18,0)
 N DFN,PROBLEMS,PXAPREDT,ORCPTDEL
"RTN","PXRPC",19,0)
 ; Vars for Info Source (IMMIS) Imm. Admin Route (IMMRT), Body Site (IMMAL), Lot, Manufacturer, Exp. Date & Comments
"RTN","PXRPC",20,0)
 N IMMISNM,IMMISIEN,IMMRTNM,IMMRTIEN,IMMRTERR,IMMALNAME,IMMALIEN,IMMALERR,IMMLOT,IMMMANUF,IMMEXPDT,IMMCOMM,IMMCOMMS,IMMLOTIEN
"RTN","PXRPC",21,0)
 N NUM,REMARK,SEQ,IMMDSG,IMMCVX,IMMCVXER
"RTN","PXRPC",22,0)
 S PKG=$$PKG2IEN^VSIT(PKGNAME) I PKG=-1 S OK=-3 Q
"RTN","PXRPC",23,0)
 S (PRV,CPT,ICD,IMM,SK,PED,HF,XAM,TRT)=0
"RTN","PXRPC",24,0)
 S I="" F  S I=$O(PCELIST(I)) Q:'I  S X=PCELIST(I) D
"RTN","PXRPC",25,0)
 . S X=PCELIST(I),TYP=$P(X,U),CODE=$P(X,U,2),CAT=$P(X,U,3),NARR=$P(X,U,4)
"RTN","PXRPC",26,0)
 . I $E(TYP,1,3)="PRV" D  Q
"RTN","PXRPC",27,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",28,0)
 . . S PRV=PRV+1
"RTN","PXRPC",29,0)
 . . S ROOT="PXAPI(""PROVIDER"","_PRV_")"
"RTN","PXRPC",30,0)
 . . S ROOT2="PXDEL(""PROVIDER"","_PRV_")"
"RTN","PXRPC",31,0)
 . . I $E(TYP,4)'="-" D
"RTN","PXRPC",32,0)
 . . . S @ROOT@("NAME")=CODE
"RTN","PXRPC",33,0)
 . . . S @ROOT@("PRIMARY")=$P(X,U,6)
"RTN","PXRPC",34,0)
 . . S @ROOT2@("NAME")=CODE
"RTN","PXRPC",35,0)
 . . S @ROOT2@("DELETE")=1
"RTN","PXRPC",36,0)
 . . S PXAPREDT=1 ;Allow edit of primary flag
"RTN","PXRPC",37,0)
 . I TYP="VST" D  Q
"RTN","PXRPC",38,0)
 . . S ROOT="PXAPI(""ENCOUNTER"",1)"
"RTN","PXRPC",39,0)
 . . I CODE="DT" S @ROOT@("ENC D/T")=$P(X,U,3) Q
"RTN","PXRPC",40,0)
 . . I CODE="PT" S @ROOT@("PATIENT")=$P(X,U,3),DFN=$P(X,U,3) Q
"RTN","PXRPC",41,0)
 . . I CODE="HL" S @ROOT@("HOS LOC")=$P(X,U,3) Q
"RTN","PXRPC",42,0)
 . . I CODE="PR" S @ROOT@("PARENT")=$P(X,U,3) Q
"RTN","PXRPC",43,0)
 . . ;prevents checkout!
"RTN","PXRPC",44,0)
 . . I CODE="VC" S @ROOT@("SERVICE CATEGORY")=$P(X,U,3) Q
"RTN","PXRPC",45,0)
 . . I CODE="SC" S @ROOT@("SC")=$P(X,U,3) Q
"RTN","PXRPC",46,0)
 . . I CODE="AO" S @ROOT@("AO")=$P(X,U,3) Q
"RTN","PXRPC",47,0)
 . . I CODE="IR" S @ROOT@("IR")=$P(X,U,3) Q
"RTN","PXRPC",48,0)
 . . I CODE="EC" S @ROOT@("EC")=$P(X,U,3) Q
"RTN","PXRPC",49,0)
 . . I CODE="MST" S @ROOT@("MST")=$P(X,U,3) Q
"RTN","PXRPC",50,0)
 . . I CODE="HNC" S @ROOT@("HNC")=$P(X,U,3) Q
"RTN","PXRPC",51,0)
 . . I CODE="CV" S @ROOT@("CV")=$P(X,U,3) Q
"RTN","PXRPC",52,0)
 . . I CODE="SHD" S @ROOT@("SHAD")=$P(X,U,3) Q
"RTN","PXRPC",53,0)
 . . I CODE="OL" D  Q
"RTN","PXRPC",54,0)
 . . . I +$P(X,U,3) S @ROOT@("INSTITUTION")=$P(X,U,3)
"RTN","PXRPC",55,0)
 . . . E  I $P(X,U,4)'="",$P(X,U,4)'="0" D
"RTN","PXRPC",56,0)
 . . . . I $$PATCH^XPDUTL("PX*1.0*96") S @ROOT@("OUTSIDE LOCATION")=$P(X,U,4)
"RTN","PXRPC",57,0)
 . . . . E  S @ROOT@("COMMENT")="OUTSIDE LOCATION:  "_$P(X,U,4)
"RTN","PXRPC",58,0)
 . I $E(TYP,1,3)="CPT" D  Q
"RTN","PXRPC",59,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",60,0)
 . . S CPT=CPT+1,ROOT="PXAPI(""PROCEDURE"","_CPT_")"
"RTN","PXRPC",61,0)
 . . S IEN=$$CODEN^ICPTCOD(CODE) ;ICR #1995
"RTN","PXRPC",62,0)
 . . S @ROOT@("PROCEDURE")=IEN
"RTN","PXRPC",63,0)
 . . I +$P(X,U,9) D
"RTN","PXRPC",64,0)
 . . . S MODS=$P(X,U,9),MODCNT=+MODS
"RTN","PXRPC",65,0)
 . . . F MODIDX=1:1:MODCNT D
"RTN","PXRPC",66,0)
 . . . . S MOD=$P($P(MODS,";",MODIDX+1),"/")
"RTN","PXRPC",67,0)
 . . . . S @ROOT@("MODIFIERS",MOD)=""
"RTN","PXRPC",68,0)
 . . S:$L(CAT) @ROOT@("CATEGORY")=CAT
"RTN","PXRPC",69,0)
 . . S:$L(NARR) @ROOT@("NARRATIVE")=NARR
"RTN","PXRPC",70,0)
 . . S:$L($P(X,U,5)) @ROOT@("QTY")=$P(X,U,5)
"RTN","PXRPC",71,0)
 . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",72,0)
 . . S:$L($P(X,U,10))>0 COMMENT($P(X,U,10))="PROCEDURE^"_CPT
"RTN","PXRPC",73,0)
 . . I $E(TYP,4)="-" S @ROOT@("DELETE")=1,@ROOT@("QTY")=0,ORCPTDEL=CPT
"RTN","PXRPC",74,0)
 . I $E(TYP,1,3)="POV" D  Q
"RTN","PXRPC",75,0)
 . . N PXDXI,PXDX
"RTN","PXRPC",76,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",77,0)
 . . F PXDXI=1:1:$L(CODE,"/") D
"RTN","PXRPC",78,0)
 . . . S PXDX=$P(CODE,"/",PXDXI)
"RTN","PXRPC",79,0)
 . . . S ICD=ICD+1,ROOT="PXAPI(""DX/PL"","_ICD_")"
"RTN","PXRPC",80,0)
 . . . S IEN=+$$CODEN^ICDCODE(PXDX,80) ;ICR #3990
"RTN","PXRPC",81,0)
 . . . S @ROOT@("DIAGNOSIS")=IEN
"RTN","PXRPC",82,0)
 . . . S @ROOT@("PRIMARY")=$S(PXDXI=1:$P(X,U,5),1:0)
"RTN","PXRPC",83,0)
 . . . S LEXIEN=$P($$EXP^LEXCODE(CODE,"ICD",DT),U),@ROOT@("LEXICON TERM")=$S(LEXIEN>0:LEXIEN,1:"")
"RTN","PXRPC",84,0)
 . . . S:$L(CAT) @ROOT@("CATEGORY")=CAT
"RTN","PXRPC",85,0)
 . . . S:$L(NARR) @ROOT@("NARRATIVE")=NARR
"RTN","PXRPC",86,0)
 . . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",87,0)
 . . . I $L($P(X,U,7)),($P(X,U,7)=1),(PXDXI=1) S @ROOT@("PL ADD")=$P(X,U,7),PROBLEMS(ICD)=NARR_U_CODE
"RTN","PXRPC",88,0)
 . . . S:$L($P(X,U,10))>0&(PXDXI=1) COMMENT($P(X,U,10))="DX/PL^"_ICD
"RTN","PXRPC",89,0)
 . . . I $E(TYP,4)="-" S @ROOT@("DELETE")=1
"RTN","PXRPC",90,0)
 . I $E(TYP,1,3)="IMM" D  Q
"RTN","PXRPC",91,0)
 . . ; If the CVX Code is present, then use it to find the corresponding Immunization,
"RTN","PXRPC",92,0)
 . . ; but only if the Immunization IEN is not specified 
"RTN","PXRPC",93,0)
 . . S IMMCVX=$P(X,U,11)
"RTN","PXRPC",94,0)
 . . I CODE="",IMMCVX'="" S CODE=$$FIND1^DIC(9999999.14,,,IMMCVX,"C",,"IMMCVXER")
"RTN","PXRPC",95,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",96,0)
 . . S IMM=IMM+1,ROOT="PXAPI(""IMMUNIZATION"","_IMM_")"
"RTN","PXRPC",97,0)
 . . S @ROOT@("IMMUN")=CODE
"RTN","PXRPC",98,0)
 . . S:$L($P(X,U,5)) @ROOT@("SERIES")=$P(X,U,5)
"RTN","PXRPC",99,0)
 . . S:$L($P(X,U,7)) @ROOT@("REACTION")=$P(X,U,7)
"RTN","PXRPC",100,0)
 . . S:$L($P(X,U,8)) @ROOT@("CONTRAINDICATED")=$P(X,U,8)
"RTN","PXRPC",101,0)
 . . S:$L($P(X,U,9)) @ROOT@("REFUSED")=$P(X,U,9)
"RTN","PXRPC",102,0)
 . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",103,0)
 . . S:$L($P(X,U,10))>0 COMMENT($P(X,U,10))="IMMUNIZATION^"_IMM
"RTN","PXRPC",104,0)
 . . ; These are the additional fields being added by PX*1.0*209
"RTN","PXRPC",105,0)
 . . S IMMISIEN=$$IMMSRC($P(X,U,12))
"RTN","PXRPC",106,0)
 . . S:IMMISIEN @ROOT@("INFO SOURCE")=IMMISIEN
"RTN","PXRPC",107,0)
 . . S IMMRTIEN=$$IMMROUTE($P(X,U,14))
"RTN","PXRPC",108,0)
 . . S:IMMRTIEN @ROOT@("ADMIN ROUTE")=IMMRTIEN
"RTN","PXRPC",109,0)
 . . S IMMALIEN=$$IMMLOC($P(X,U,15))
"RTN","PXRPC",110,0)
 . . S:IMMALIEN @ROOT@("ANATOMIC LOC")=IMMALIEN
"RTN","PXRPC",111,0)
 . . S IMMLOT=$$IMMLOT($P(X,U,16),$P(X,U,17),$P(X,U,18))
"RTN","PXRPC",112,0)
 . . S IMMLOTIEN=$P(IMMLOT,"^",1)
"RTN","PXRPC",113,0)
 . . S IMMCOMM=$P(IMMLOT,"^",2)
"RTN","PXRPC",114,0)
 . . S:IMMLOTIEN @ROOT@("LOT NUM")=IMMLOTIEN
"RTN","PXRPC",115,0)
 . . S IMMDSG=$$IMMDSG($P(X,U,13))
"RTN","PXRPC",116,0)
 . . I $P(IMMDSG,U,1)'="" D
"RTN","PXRPC",117,0)
 . . . S @ROOT@("DOSE")=$P(IMMDSG,U,1)
"RTN","PXRPC",118,0)
 . . . I $P(IMMDSG,U,2) S @ROOT@("DOSE UNITS")=$P(IMMDSG,U,2)
"RTN","PXRPC",119,0)
 . . I $P(IMMDSG,U,3)'="" D  ; add Dosage to comments
"RTN","PXRPC",120,0)
 . . . S IMMCOMM=$S($G(IMMCOMM)'="":IMMCOMM_"; ",1:"")_$P(IMMDSG,U,3)
"RTN","PXRPC",121,0)
 . . I IMMCOMM'="" D
"RTN","PXRPC",122,0)
 . . . ; If we have something to add to the Imm comment, either add it to the existing comment
"RTN","PXRPC",123,0)
 . . . ; (if one exists) or just set it in the COMMENT field.
"RTN","PXRPC",124,0)
 . . . I $L($P(X,U,10)) S IMMCOMMS($P(X,U,10))=IMMCOMM ; This will get added later to the existing comment
"RTN","PXRPC",125,0)
 . . . E  S @ROOT@("COMMENT")=IMMCOMM
"RTN","PXRPC",126,0)
 . . S:$P(X,U,19)>0 @ROOT@("EVENT D/T")=$P(X,U,19)
"RTN","PXRPC",127,0)
 . . S:$P(X,U,20)>0 @ROOT@("ORD PROVIDER")=$P(X,U,20)
"RTN","PXRPC",128,0)
 . . I $P(X,U,21)'="" D IMMVIS($P(X,U,21),ROOT)
"RTN","PXRPC",129,0)
 . . I $P(X,U,22)'="" D IMMRMRKS($P(X,U,22),IMM,.REMARK)
"RTN","PXRPC",130,0)
 . . I $E(TYP,4)="-" S @ROOT@("DELETE")=1
"RTN","PXRPC",131,0)
 . I $E(TYP,1,2)="SK" D  Q
"RTN","PXRPC",132,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",133,0)
 . . S SK=SK+1,ROOT="PXAPI(""SKIN TEST"","_SK_")"
"RTN","PXRPC",134,0)
 . . S @ROOT@("TEST")=CODE
"RTN","PXRPC",135,0)
 . . S:$L($P(X,U,5)) @ROOT@("RESULT")=$P(X,U,5)
"RTN","PXRPC",136,0)
 . . S:$L($P(X,U,7)) @ROOT@("READING")=$P(X,U,7)
"RTN","PXRPC",137,0)
 . . S:$L($P(X,U,8)) @ROOT@("D/T READ")=$P(X,U,8)
"RTN","PXRPC",138,0)
 . . S:$L($P(X,U,9)) @ROOT@("EVENT D/T")=$P(X,U,9)
"RTN","PXRPC",139,0)
 . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",140,0)
 . . S:$L($P(X,U,10))>0 COMMENT($P(X,U,10))="SKIN TEST^"_SK
"RTN","PXRPC",141,0)
 . . I $E(TYP,3)="-" S @ROOT@("DELETE")=1
"RTN","PXRPC",142,0)
 . I $E(TYP,1,3)="PED" D  Q
"RTN","PXRPC",143,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",144,0)
 . . S PED=PED+1,ROOT="PXAPI(""PATIENT ED"","_PED_")"
"RTN","PXRPC",145,0)
 . . S @ROOT@("TOPIC")=CODE
"RTN","PXRPC",146,0)
 . . S:$L($P(X,U,5)) @ROOT@("UNDERSTANDING")=$P(X,U,5)
"RTN","PXRPC",147,0)
 . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",148,0)
 . . S:$L($P(X,U,10))>0 COMMENT($P(X,U,10))="PATIENT ED^"_PED
"RTN","PXRPC",149,0)
 . . I $E(TYP,4)="-" S @ROOT@("DELETE")=1
"RTN","PXRPC",150,0)
 . I $E(TYP,1,2)="HF" D  Q
"RTN","PXRPC",151,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",152,0)
 . . S HF=HF+1,ROOT="PXAPI(""HEALTH FACTOR"","_HF_")"
"RTN","PXRPC",153,0)
 . . S @ROOT@("HEALTH FACTOR")=CODE
"RTN","PXRPC",154,0)
 . . S:$L($P(X,U,5)) @ROOT@("LEVEL/SEVERITY")=$P(X,U,5)
"RTN","PXRPC",155,0)
 . . S:$P(X,U,6)'>0 $P(X,U,6)=$G(PXAPI("PROVIDER",1,"NAME"))
"RTN","PXRPC",156,0)
 . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",157,0)
 . . S:$L($P(X,U,11)) @ROOT@("EVENT D/T")=$P($P(X,U,11),";",1)
"RTN","PXRPC",158,0)
 . . S:$L($P(X,U,11)) SRC=$P($P(X,U,11),";",2)
"RTN","PXRPC",159,0)
 . . S:$L($P(X,U,10))>0 COMMENT($P(X,U,10))="HEALTH FACTOR^"_HF
"RTN","PXRPC",160,0)
 . . I $E(TYP,3)="-" S @ROOT@("DELETE")=1
"RTN","PXRPC",161,0)
 . I $E(TYP,1,3)="XAM" D  Q
"RTN","PXRPC",162,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",163,0)
 . . S XAM=XAM+1,ROOT="PXAPI(""EXAM"","_XAM_")"
"RTN","PXRPC",164,0)
 . . S @ROOT@("EXAM")=CODE
"RTN","PXRPC",165,0)
 . . S:$L($P(X,U,5)) @ROOT@("RESULT")=$P(X,U,5)
"RTN","PXRPC",166,0)
 . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",167,0)
 . . S:$L($P(X,U,10))>0 COMMENT($P(X,U,10))="EXAM^"_XAM
"RTN","PXRPC",168,0)
 . . I $E(TYP,4)="-" S @ROOT@("DELETE")=1
"RTN","PXRPC",169,0)
 . I $E(TYP,1,3)="TRT" D  Q
"RTN","PXRPC",170,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",171,0)
 . . S TRT=TRT+1,ROOT="PXAPI(""TREATMENT"","_TRT_")"
"RTN","PXRPC",172,0)
 . . S @ROOT@("IMMUN")=CODE
"RTN","PXRPC",173,0)
 . . S:$L(CAT) @ROOT@("CATEGORY")=CAT
"RTN","PXRPC",174,0)
 . . S:$L(NARR) @ROOT@("NARRATIVE")=NARR
"RTN","PXRPC",175,0)
 . . S:$L($P(X,U,5)) @ROOT@("QTY")=$P(X,U,5)
"RTN","PXRPC",176,0)
 . . S:$P(X,U,6)>0 @ROOT@("ENC PROVIDER")=$P(X,U,6)
"RTN","PXRPC",177,0)
 . . S:$L($P(X,U,10))>0 COMMENT($P(X,U,10))="TREATMENT^"_TRT
"RTN","PXRPC",178,0)
 . . I $E(TYP,4)="-" S @ROOT@("DELETE")=1,@ROOT@("QTY")=0
"RTN","PXRPC",179,0)
 . I $E(TYP,1,3)="COM" D  Q
"RTN","PXRPC",180,0)
 . . Q:'$L(CODE)
"RTN","PXRPC",181,0)
 . . Q:'$L(CAT)
"RTN","PXRPC",182,0)
 . . S COMMENTS(CODE)=$P(X,U,3,999)
"RTN","PXRPC",183,0)
 ;Store the comments
"RTN","PXRPC",184,0)
 S COM=""
"RTN","PXRPC",185,0)
 ;F  S COM=$O(COMMENT(COM)) Q:COM=""  S:$D(COMMENTS(COM)) PXAPI($P(COMMENT(COM),"^",1),$P(COMMENT(COM),"^",2),"COMMENT")=COMMENTS(COM)
"RTN","PXRPC",186,0)
 F  S COM=$O(COMMENT(COM)) Q:COM=""  D:$D(COMMENTS(COM))
"RTN","PXRPC",187,0)
 . I $G(IMMCOMMS(COM))'="" S COMMENTS(COM)=COMMENTS(COM)_$S(COMMENTS(COM)="":"",1:" ")_IMMCOMMS(COM)
"RTN","PXRPC",188,0)
 . S PXAPI($P(COMMENT(COM),"^",1),$P(COMMENT(COM),"^",2),"COMMENT")=COMMENTS(COM)
"RTN","PXRPC",189,0)
 ;
"RTN","PXRPC",190,0)
 ;Store the Remarks (currently used by immunizations) - PX,210
"RTN","PXRPC",191,0)
 S COM=""
"RTN","PXRPC",192,0)
 F  S COM=$O(REMARK(COM)) Q:COM=""  I $D(COMMENTS(COM)) D
"RTN","PXRPC",193,0)
 . S TYP=$P(REMARK(COM),"^",1)
"RTN","PXRPC",194,0)
 . S NUM=$P(REMARK(COM),"^",2)
"RTN","PXRPC",195,0)
 . S SEQ=$O(PXAPI(TYP,NUM,"REMARKS",""),-1)+1
"RTN","PXRPC",196,0)
 . S PXAPI(TYP,NUM,"REMARKS",SEQ,0)=COMMENTS(COM)
"RTN","PXRPC",197,0)
 ;
"RTN","PXRPC",198,0)
 S PXAPI("ENCOUNTER",1,"ENCOUNTER TYPE")="P"
"RTN","PXRPC",199,0)
DATA2PCE ;
"RTN","PXRPC",200,0)
 I '$D(PXAPI)#10 S OK=-3 Q
"RTN","PXRPC",201,0)
 I '($D(PXAVST)#2) S PXAVST=""
"RTN","PXRPC",202,0)
 S OK=$$DATA2PCE^PXAI("PXAPI",PKG,SRC,.PXAVST,"","",.ERROR,"","","")
"RTN","PXRPC",203,0)
 Q
"RTN","PXRPC",204,0)
 ;
"RTN","PXRPC",205,0)
IMMSRC(IMMIS) ; Returns Event Info Source IEN
"RTN","PXRPC",206,0)
 N IMMISHL,IMMISIEN,X
"RTN","PXRPC",207,0)
 S IMMISHL=$P(IMMIS,";",1)
"RTN","PXRPC",208,0)
 S IMMISIEN=$P(IMMIS,";",2)
"RTN","PXRPC",209,0)
 ; Look up the value in the "H" Cross-reference
"RTN","PXRPC",210,0)
 I 'IMMISIEN D
"RTN","PXRPC",211,0)
 . S IMMISIEN=$$FIND1^DIC(920.1,,,IMMISHL,"H",,"IMMISERR")
"RTN","PXRPC",212,0)
 Q IMMISIEN
"RTN","PXRPC",213,0)
 ;
"RTN","PXRPC",214,0)
IMMROUTE(IMMRT) ; Returns Route IEN
"RTN","PXRPC",215,0)
 N IMMRTHL,IMMRTIEN,IMMRTNM,X
"RTN","PXRPC",216,0)
 S IMMRTNM=$P(IMMRT,";",1)
"RTN","PXRPC",217,0)
 S IMMRTHL=$P(IMMRT,";",2)
"RTN","PXRPC",218,0)
 S IMMRTIEN=$P(IMMRT,";",3)
"RTN","PXRPC",219,0)
 I 'IMMRTIEN,IMMRTHL'="" D
"RTN","PXRPC",220,0)
 . S IMMRTIEN=$$FIND1^DIC(920.2,,,IMMRTHL,"H",,"IMMRTERR")
"RTN","PXRPC",221,0)
 I 'IMMRTIEN,IMMRTNM'="" D
"RTN","PXRPC",222,0)
 . S IMMRTIEN=$$FIND1^DIC(920.2,,,IMMRTNM,"B",,"IMMRTERR")
"RTN","PXRPC",223,0)
 Q IMMRTIEN
"RTN","PXRPC",224,0)
 ;
"RTN","PXRPC",225,0)
IMMLOC(IMMAL) ; Returns Anatomic Location IEN
"RTN","PXRPC",226,0)
 N IMMALHL,IMMALIEN,IMMALNM,X
"RTN","PXRPC",227,0)
 S IMMALNM=$P(IMMAL,";",1)
"RTN","PXRPC",228,0)
 S IMMALHL=$P(IMMAL,";",2)
"RTN","PXRPC",229,0)
 S IMMALIEN=$P(IMMAL,";",3)
"RTN","PXRPC",230,0)
 I 'IMMALIEN,IMMALHL'="" D
"RTN","PXRPC",231,0)
 . S IMMALIEN=$$FIND1^DIC(920.3,,,IMMALHL,"B",,"IMMALERR")
"RTN","PXRPC",232,0)
 I 'IMMALIEN,IMMALNM'="" D
"RTN","PXRPC",233,0)
 . S IMMALIEN=$$FIND1^DIC(920.3,,,IMMALNM,"B",,"IMMALERR")
"RTN","PXRPC",234,0)
 Q IMMALIEN
"RTN","PXRPC",235,0)
 ;
"RTN","PXRPC",236,0)
IMMLOT(IMMLOT,IMMMANUF,IMMEXPDT) ; Returns Lot_IEN^Comment
"RTN","PXRPC",237,0)
 N IMMCOMM,IMMLOTIEN,IMMLOTNM,X
"RTN","PXRPC",238,0)
 S IMMLOTNM=$P(IMMLOT,";",1)
"RTN","PXRPC",239,0)
 S IMMLOTIEN=$P(IMMLOT,";",2)
"RTN","PXRPC",240,0)
 ;
"RTN","PXRPC",241,0)
 I IMMLOTIEN Q IMMLOTIEN
"RTN","PXRPC",242,0)
 ;
"RTN","PXRPC",243,0)
 ; If the Lot Number, Manufacturer and Expiration Date are all specified,
"RTN","PXRPC",244,0)
 ; then find an entry matching all three values in File 9999999.41 (IMMUNIZATION LOT)
"RTN","PXRPC",245,0)
 ; If we don't find a match, then add the fields to the Comment.
"RTN","PXRPC",246,0)
 ; For now, we will not receive the Expiration Date from Walgreens, so we always update the Comment.
"RTN","PXRPC",247,0)
 S IMMCOMM=""
"RTN","PXRPC",248,0)
 S:IMMLOTNM'="" IMMCOMM=IMMCOMM_$S(IMMCOMM="":"",1:" ")_"Lot#: "_IMMLOTNM
"RTN","PXRPC",249,0)
 S:IMMMANUF'="" IMMCOMM=IMMCOMM_$S(IMMCOMM="":"",1:" ")_"Mfr: "_IMMMANUF
"RTN","PXRPC",250,0)
 S:IMMEXPDT'="" IMMCOMM=IMMCOMM_$S(IMMCOMM="":"",1:" ")_"Expiration Date: "_IMMEXPDT
"RTN","PXRPC",251,0)
 Q "^"_IMMCOMM
"RTN","PXRPC",252,0)
 ;
"RTN","PXRPC",253,0)
IMMVIS(IMMVISMULT,ROOT) ; Sets ROOT's VIS multiple
"RTN","PXRPC",254,0)
 N IMMVIS,IMMVISDT,IMMVISENTRY,PXSEQ,PXX,X
"RTN","PXRPC",255,0)
 S PXSEQ=0
"RTN","PXRPC",256,0)
 F PXX=1:1:$L(IMMVISMULT,";") D
"RTN","PXRPC",257,0)
 . S IMMVISENTRY=$$TRIM^XLFSTR($P(IMMVISMULT,";",PXX))
"RTN","PXRPC",258,0)
 . S IMMVIS=$P(IMMVISENTRY,"/",1)
"RTN","PXRPC",259,0)
 . I 'IMMVIS Q
"RTN","PXRPC",260,0)
 . S IMMVISDT=$P(IMMVISENTRY,"/",2)
"RTN","PXRPC",261,0)
 . I IMMVISDT S IMMVIS=IMMVIS_U_IMMVISDT
"RTN","PXRPC",262,0)
 . S PXSEQ=PXSEQ+1
"RTN","PXRPC",263,0)
 . S @ROOT@("VIS",PXSEQ,0)=IMMVIS
"RTN","PXRPC",264,0)
 Q
"RTN","PXRPC",265,0)
 ;
"RTN","PXRPC",266,0)
IMMRMRKS(IMMREMARKS,IMMNUM,REMARK) ; Sets REMARK array
"RTN","PXRPC",267,0)
 N PXEND,PXSTART,PXX,X
"RTN","PXRPC",268,0)
 S PXSTART=$P(IMMREMARKS,";",1)
"RTN","PXRPC",269,0)
 S PXEND=$P(IMMREMARKS,";",2)
"RTN","PXRPC",270,0)
 I ('PXSTART)!('PXEND)!(PXEND<PXSTART) Q
"RTN","PXRPC",271,0)
 F PXX=PXSTART:1:PXEND D
"RTN","PXRPC",272,0)
 . S REMARK(PXX)="IMMUNIZATION^"_IMMNUM
"RTN","PXRPC",273,0)
 Q
"RTN","PXRPC",274,0)
 ;
"RTN","PXRPC",275,0)
IMMDSG(IMMDSG) ;
"RTN","PXRPC",276,0)
 N IMMDOSE,IMMUNIT,IMMUNITIEN,IMMDOSEV,IMMUNERR,X
"RTN","PXRPC",277,0)
 S IMMDSG=$$TRIM^XLFSTR(IMMDSG)
"RTN","PXRPC",278,0)
 I IMMDSG="" Q ""
"RTN","PXRPC",279,0)
 S IMMDOSE=$P(IMMDSG,";",1)
"RTN","PXRPC",280,0)
 S IMMUNIT=$P(IMMDSG,";",2)
"RTN","PXRPC",281,0)
 S IMMUNITIEN=$P(IMMDSG,";",3)
"RTN","PXRPC",282,0)
 I IMMDSG[" ",IMMDSG'[";" D  ;Remove this DO block when VLER DAS starts using ";" between dose and units
"RTN","PXRPC",283,0)
 . S IMMDOSE=$P(IMMDSG," ",1)
"RTN","PXRPC",284,0)
 . S IMMUNIT=$P(IMMDSG," ",2)
"RTN","PXRPC",285,0)
 ;
"RTN","PXRPC",286,0)
 I IMMDOSE="" Q ""
"RTN","PXRPC",287,0)
 ;
"RTN","PXRPC",288,0)
 I IMMUNIT'="",'IMMUNITIEN D
"RTN","PXRPC",289,0)
 . N UCUMDATA
"RTN","PXRPC",290,0)
 . D UCUMDATA^LEXMUCUM(IMMUNIT,.UCUMDATA)
"RTN","PXRPC",291,0)
 . S IMMUNITIEN=$O(UCUMDATA(0))
"RTN","PXRPC",292,0)
 D CHK^DIE(9000010.11,1312,,IMMDOSE,.IMMDOSEV,"IMMUNERR")
"RTN","PXRPC",293,0)
 I IMMUNITIEN,IMMDOSEV'="^" Q IMMDOSEV_U_IMMUNITIEN
"RTN","PXRPC",294,0)
 ;
"RTN","PXRPC",295,0)
 Q U_U_"Dosage: "_IMMDOSE_" "_IMMUNIT
"RTN","PXVEDIT")
0^19^B3545122^n/a
"RTN","PXVEDIT",1,0)
PXVEDIT ;BIR/CML3,ADM - LOT NUMBER EDIT ;28 MAY 2015
"RTN","PXVEDIT",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXVEDIT",3,0)
 ;
"RTN","PXVEDIT",4,0)
EN ; entry point for PXTT EDIT IMMUNIZATION LOT option
"RTN","PXVEDIT",5,0)
 N PXVOUT,X,Y
"RTN","PXVEDIT",6,0)
 S PXVOUT=0
"RTN","PXVEDIT",7,0)
PICK W @IOF,"IMMUNIZATION INVENTORY FUNCTIONS",!
"RTN","PXVEDIT",8,0)
FUNC ; select function
"RTN","PXVEDIT",9,0)
 K DIR S DIR("A",1)="1. Enter/Edit Immunization Lot",DIR("A",2)="2. Display/Print Immunization Inventory Report",DIR("A",3)=""
"RTN","PXVEDIT",10,0)
 S DIR("A")="Enter a number",DIR(0)="NO^1:2" D ^DIR K DIR I $D(DTOUT)!$D(DUOUT)!'Y S PXVOUT=1 D END Q
"RTN","PXVEDIT",11,0)
 I X["?" G PICK
"RTN","PXVEDIT",12,0)
 I Y=2 D ^PXVINV D END Q
"RTN","PXVEDIT",13,0)
F1 ; entry point for lot number enter/edit
"RTN","PXVEDIT",14,0)
 N DA,DIE,DIC,DIR,DR,DTOUT,DUOUT,PXVIEN,X,Y
"RTN","PXVEDIT",15,0)
 F  D LN Q:PXVOUT
"RTN","PXVEDIT",16,0)
 K PXVOUT
"RTN","PXVEDIT",17,0)
 Q
"RTN","PXVEDIT",18,0)
LN ; edit lot number or enter new lot number
"RTN","PXVEDIT",19,0)
 W @IOF,!,?10,"Enter/Edit Immunization Lot",!
"RTN","PXVEDIT",20,0)
 K DIC S DIC="^AUTTIML(",DIC(0)="AEMLZ" D ^DIC K DIC I $D(DTOUT)!$D(DUOUT)!(X="") S PXVOUT=1 D END Q
"RTN","PXVEDIT",21,0)
 S PXVIEN=$P($G(Y),"^")
"RTN","PXVEDIT",22,0)
EDIT ; edit existing lot number
"RTN","PXVEDIT",23,0)
 I $D(^AUPNVIMM("LN",PXVIEN)) D  D END Q
"RTN","PXVEDIT",24,0)
 .W !!,"LOT NUMBER: "_$P(^AUTTIML(PXVIEN,0),"^")_"// ** Already assigned and cannot be edited. **",$C(7)
"RTN","PXVEDIT",25,0)
 .S DA=PXVIEN,DIE=9999999.41,DR=".02;.04;.09;.03;.11;.12;.15;.18" D ^DIE
"RTN","PXVEDIT",26,0)
 K DA,DIE,DR S DA=PXVIEN,DIE=9999999.41,DR=".01;.04;.02;.09;.03;.11;.12;.15;.18" D ^DIE
"RTN","PXVEDIT",27,0)
 D END
"RTN","PXVEDIT",28,0)
 Q
"RTN","PXVEDIT",29,0)
END K DA,DIE,DIC,DIR,DR,DTOUT,DUOUT,PXVIEN,X,Y
"RTN","PXVEDIT",30,0)
 Q
"RTN","PXVINV")
0^20^B25607410^n/a
"RTN","PXVINV",1,0)
PXVINV ;BIR/ADM - IMMUNIZATION INVENTORY REPORT ;27 MAY 2015
"RTN","PXVINV",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXVINV",3,0)
 ;
"RTN","PXVINV",4,0)
EN ; entry point for inventory report
"RTN","PXVINV",5,0)
 N C,CNT,DIC,DIR,LINE,PAGE,PXV,PXV0,PXVCT,PXVEXP,PXVHALT,PXVHDR,PXVIMM,PXVLN,PXVMAN,PXVNAME,PXVOUT,PXVPRINT,PXVSEL,PXVSTAT,PXVTITL,PXVVAC,X,Y,Z
"RTN","PXVINV",6,0)
 S PXVOUT=0
"RTN","PXVINV",7,0)
 W @IOF,"IMMUNIZATION INVENTORY REPORTS",!
"RTN","PXVINV",8,0)
 K DIR S DIR("A",1)="Display/Print Which of the Following?",DIR("A",2)=""
"RTN","PXVINV",9,0)
 S DIR("A",3)="1. All or Selected Active Inventory",DIR("A",4)="2. Active Inventory With Zero Doses Available"
"RTN","PXVINV",10,0)
 S DIR("A",5)="",DIR("A")="Enter a number",DIR(0)="NO^1:2"
"RTN","PXVINV",11,0)
 S DIR("?",1)=" Enter '1' to display/print all or selected active immunization inventory"
"RTN","PXVINV",12,0)
 S DIR("?",2)=" items or enter '2' to display/print all active immunization inventory"
"RTN","PXVINV",13,0)
 S DIR("?")=" items with zero doses in stock." D ^DIR K DIR I $D(DTOUT)!$D(DUOUT)!'Y S PXVOUT=1 D END Q
"RTN","PXVINV",14,0)
 S PXVSEL=Y
"RTN","PXVINV",15,0)
 I PXVSEL=2 G DEV
"RTN","PXVINV",16,0)
 W ! K DIR S DIR("A")="Display Inventory Information for All Immunizations",DIR("B")="YES",DIR(0)="Y"
"RTN","PXVINV",17,0)
 S DIR("?",1)=" Press ENTER to display inventory information for all immunizations or"
"RTN","PXVINV",18,0)
 S DIR("?")=" enter 'NO' to select specific immunizations."
"RTN","PXVINV",19,0)
 D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S PXVOUT=1 D END Q
"RTN","PXVINV",20,0)
 I 'Y D IMM I PXVOUT D END Q
"RTN","PXVINV",21,0)
DEV K IOP,%ZIS,POP,IO("Q") S %ZIS("A")="Display/Print on which Device: ",%ZIS="QM"
"RTN","PXVINV",22,0)
 W ! D ^%ZIS I POP S PXVOUT=1 G END
"RTN","PXVINV",23,0)
 I $D(IO("Q")) K IO("Q") S ZTDESC="IMMUNIZATION INVENTORY",ZTRTN="BEG^PXVINV",(ZTSAVE("PXVIMM*"),ZTSAVE("PXVSEL"))="" D ^%ZTLOAD G END
"RTN","PXVINV",24,0)
BEG ;
"RTN","PXVINV",25,0)
 U IO S (PXVHDR,PXVIMM,PXVOUT)=0,PAGE=1 K ^TMP("PXV",$J) S Y=DT X ^DD("DD") S PXVPRINT="DATE PRINTED: "_Y
"RTN","PXVINV",26,0)
 S PXVTITL="ACTIVE IMMUNIZATION INVENTORY"
"RTN","PXVINV",27,0)
 I PXVSEL=1 S PXVTITL=$S($O(PXVIMM(0)):"SELECTED",1:"ALL")_" "_PXVTITL
"RTN","PXVINV",28,0)
 I PXVSEL=2 S PXVTITL=PXVTITL_" - ZERO DOSES AVAILABLE"
"RTN","PXVINV",29,0)
 I $O(PXVIMM(0)) S PXVIMM=1
"RTN","PXVINV",30,0)
 S (PXVVAC,CNT)=0 F  S PXVVAC=$O(^AUTTIML("C",PXVVAC)) Q:'PXVVAC!PXVOUT  D
"RTN","PXVINV",31,0)
 .S PXVLN=0 F  S PXVLN=$O(^AUTTIML("C",PXVVAC,PXVLN)) Q:'PXVLN!PXVOUT  D UTIL
"RTN","PXVINV",32,0)
 D HDR,PRINT,END
"RTN","PXVINV",33,0)
 Q
"RTN","PXVINV",34,0)
UTIL ;
"RTN","PXVINV",35,0)
 S PXV0=$G(^AUTTIML(PXVLN,0)) I $P(PXV0,"^",3)=0 D
"RTN","PXVINV",36,0)
 .S Z=$E($P($G(^AUTTIMM(PXVVAC,0)),"^"),1,80)
"RTN","PXVINV",37,0)
 .I PXVSEL=1 D
"RTN","PXVINV",38,0)
 ..I PXVIMM S:$D(PXVIMM(PXVVAC)) ^TMP("PXV",$J,Z,PXVLN)=PXV0,CNT=CNT+1,^TMP("PXV",$J)=CNT Q
"RTN","PXVINV",39,0)
 ..S ^TMP("PXV",$J,Z,PXVLN)=PXV0,CNT=CNT+1,^TMP("PXV",$J)=CNT Q
"RTN","PXVINV",40,0)
 .I PXVSEL=2,$P(PXV0,"^",12)=0 S ^TMP("PXV",$J,Z,PXVLN)=PXV0,CNT=CNT+1,^TMP("PXV",$J)=CNT
"RTN","PXVINV",41,0)
 Q
"RTN","PXVINV",42,0)
IMM ; select immunization(s) for display
"RTN","PXVINV",43,0)
 W !! S PXVIMM=1 K DIC S DIC("S")="I '$P(^(0),""^"",7)",DIC=9999999.14,DIC(0)="QEAMZ",DIC("A")="Display Inventory Information for which Immunization? " D ^DIC I Y<0 S PXVOUT=1 Q
"RTN","PXVINV",44,0)
 S PXVCT=+Y,PXVIMM(PXVCT)=+Y
"RTN","PXVINV",45,0)
MORE ; ask for more immunizations
"RTN","PXVINV",46,0)
 K DIC S DIC("S")="I '$P(^(0),""^"",7)",DIC=9999999.14,DIC(0)="QEAMZ",DIC("A")="Select an Additional Immunization:  " D ^DIC I Y>0 S PXVCT=+Y,PXVIMM(PXVCT)=+Y G MORE
"RTN","PXVINV",47,0)
 Q
"RTN","PXVINV",48,0)
PRINT ; print report
"RTN","PXVINV",49,0)
 I $Y+5>IOSL D HDR I PXVOUT Q
"RTN","PXVINV",50,0)
 S PXVNAME="" F  S PXVNAME=$O(^TMP("PXV",$J,PXVNAME)) Q:PXVNAME=""!PXVOUT  S PXVLN=0 F  S PXVLN=$O(^TMP("PXV",$J,PXVNAME,PXVLN)) Q:'PXVLN!PXVOUT  D INV Q:PXVOUT
"RTN","PXVINV",51,0)
 S PXVNAME="" I $O(^TMP("PXV",$J,PXVNAME))="" W !,"NO ACTIVE IMMUNIZATION INVENTORY FOUND" I PXVSEL=2 W " WITH ZERO DOSES AVAILABLE"
"RTN","PXVINV",52,0)
 Q
"RTN","PXVINV",53,0)
INV ;
"RTN","PXVINV",54,0)
 I $Y+4>IOSL D HDR I PXVOUT Q
"RTN","PXVINV",55,0)
 S PXV0=^TMP("PXV",$J,PXVNAME,PXVLN)
"RTN","PXVINV",56,0)
 F I=1,2,3,4,9,12 S PXV(I)=$P(PXV0,"^",I)
"RTN","PXVINV",57,0)
 S Y=PXV(2),C=$P(^DD(9999999.41,.02,0),"^",2) D:Y'="" Y^DIQ S PXVMAN=Y
"RTN","PXVINV",58,0)
 S Y=PXV(3),C=$P(^DD(9999999.41,.03,0),"^",2) D:Y'="" Y^DIQ S PXVSTAT=Y
"RTN","PXVINV",59,0)
 S Y=PXV(4),C=$P(^DD(9999999.41,.04,0),"^",2) D:Y'="" Y^DIQ S PXVVAC=Y
"RTN","PXVINV",60,0)
 S Y=PXV(9),C=$P(^DD(9999999.41,.09,0),"^",2) D:Y'="" Y^DIQ S PXVEXP=Y
"RTN","PXVINV",61,0)
 W !,PXVVAC,!,PXV(1),?30,PXVSTAT,?45,PXV(12),?65,PXVEXP,!,PXVMAN,!
"RTN","PXVINV",62,0)
 Q
"RTN","PXVINV",63,0)
END I 'PXVOUT,$E(IOST)="C" W !! K DIR S DIR(0)="FOA",DIR("A")="Press Enter/Return key to continue " D ^DIR K DIR
"RTN","PXVINV",64,0)
 W:$E(IOST)="P" @IOF K ^TMP("PXV",$J) I $D(ZTQUEUED) Q:$G(ZTSTOP)  S ZTREQ="@" Q
"RTN","PXVINV",65,0)
 K C,CNT,DIC,DIR,LINE,PAGE,PXV,PXV0,PXVCT,PXVEXP,PXVHALT,PXVHDR,PXVIMM,PXVLN,PXVMAN,PXVNAME,PXVOUT,PXVPRINT,PXVSEL,PXVSTAT,PXVTITL,PXVVAC,X,Y,Z
"RTN","PXVINV",66,0)
 D ^%ZISC W @IOF
"RTN","PXVINV",67,0)
 Q
"RTN","PXVINV",68,0)
HDR ; print heading
"RTN","PXVINV",69,0)
 I $D(ZTQUEUED) D STOP I PXVHALT S PXVOUT=1 Q
"RTN","PXVINV",70,0)
 I $E(IOST)'="P",PXVHDR K DIR S DIR(0)="FOA",DIR("A")="Press Enter/Return key to continue " D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S PXVOUT=1 Q
"RTN","PXVINV",71,0)
 W @IOF,!,?(80-$L(PXVTITL)\2),PXVTITL
"RTN","PXVINV",72,0)
 I $E(IOST)="P" W !,?(80-$L(PXVPRINT)\2),PXVPRINT,!
"RTN","PXVINV",73,0)
 W !,"IMMUNIZATION",!,"LOT MUNBER",?30,"STATUS",?45,"DOSES UNUSED",?65,"EXPIRATION DATE",!,"MANUFACTURER",! F LINE=1:1:80 W "="
"RTN","PXVINV",74,0)
 S PXVHDR=1
"RTN","PXVINV",75,0)
 Q
"RTN","PXVINV",76,0)
STOP ;
"RTN","PXVINV",77,0)
 S PXVHALT=0 Q:'$D(^%ZIS(14.7))
"RTN","PXVINV",78,0)
 S ZTSTOP=0 I $$S^%ZTLOAD S (PXVHALT,ZTSTOP)=1 W !!!,?10,"** Task Being Stopped at User's Request **",!!! K ZTREQ
"RTN","PXVINV",79,0)
 Q
"RTN","PXVNITLY")
0^21^B518720^n/a
"RTN","PXVNITLY",1,0)
PXVNITLY ;BIR/CML3,ADM - IMMUNIZATION NIGHTLY TASK ;20 MAY 2015
"RTN","PXVNITLY",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXVNITLY",3,0)
 ;
"RTN","PXVNITLY",4,0)
EXP ; set STATUS of expired lots to INACTIVE
"RTN","PXVNITLY",5,0)
 ; - must be run nightly immediately after midnight
"RTN","PXVNITLY",6,0)
 ; - loops through entire list every time to avoid missing dates in case
"RTN","PXVNITLY",7,0)
 ;   the process fails to run daily for whatever reason
"RTN","PXVNITLY",8,0)
 ;
"RTN","PXVNITLY",9,0)
 N DA,DIE,DR,PXVDT,X
"RTN","PXVNITLY",10,0)
 D DT^DICRW
"RTN","PXVNITLY",11,0)
 S PXVDT=0
"RTN","PXVNITLY",12,0)
 F  S PXVDT=$O(^AUTTIML("AE",PXVDT)) Q:'PXVDT  I DT>PXVDT D
"RTN","PXVNITLY",13,0)
 .S DA=0 F  S DA=$O(^AUTTIML("AE",PXVDT,DA)) Q:'DA  D
"RTN","PXVNITLY",14,0)
 ..S X=$P($G(^AUTTIML(DA,0)),"^",3)
"RTN","PXVNITLY",15,0)
 ..I 'X S DIE="^AUTTIML(",DR=".03////1" D ^DIE
"RTN","PXVNITLY",16,0)
 Q
"RTN","PXVNITLY",17,0)
LXC ; check for lot number entries that have expired
"RTN","PXVNITLY",18,0)
 ; need to find way to NOT loop through entire list every time,
"RTN","PXVNITLY",19,0)
 ; to stop at orders already checked
"RTN","PXVNITLY",20,0)
 ; PXVDT - date (no time), seeded with today's date
"RTN","PXVNITLY",21,0)
 ; "AE" x-ref - ^AUTTIML("AE",lot number expiration date, lot number IEN)
"RTN","PXVNITLY",22,0)
 ;
"RTN","PXVNITLY",23,0)
 ;
"RTN","PXVNITLY",24,0)
 ;N PXVDT,%,$H,DA,DIE,DILOCKTM,DISYS,X,Y
"RTN","PXVNITLY",25,0)
 ;D DT^DICRW S PXVDT=DT
"RTN","PXVNITLY",26,0)
 ;F  S PXVDT=$O(^AUTTIML("AE",PXVDT),-1) Q:'PXVDT  D  ;
"RTN","PXVNITLY",27,0)
 ;.S DA=0 F  S DA=$O(^AUTTIML("AE",PXVDT,DA)) Q:'DA  D  ;
"RTN","PXVNITLY",28,0)
 ;..S X=$P($G(^AUTTIML(DA,0)),"^",3)
"RTN","PXVNITLY",29,0)
 ;..I 'X S DIE="^AUTTIML(",DR=".O3///2" D ^DIE
"RTN","PXVNITLY",30,0)
 Q
"RTN","PXVP210")
0^^B84329525^n/a
"RTN","PXVP210",1,0)
PXVP210 ;BPOIFO/LMT - PX*1*210 KIDS Routine ;08/19/15  22:15
"RTN","PXVP210",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXVP210",3,0)
 ;
"RTN","PXVP210",4,0)
 ; Reference to ^PXRMINDX(9000010.11) supported by ICR #4290
"RTN","PXVP210",5,0)
 ; Reference to BLDINDEX^PXRMSXRM supported by ICR #6210
"RTN","PXVP210",6,0)
 ; Reference to INDEXD^PXRMDIEV supported by ICR #6059
"RTN","PXVP210",7,0)
 ;
"RTN","PXVP210",8,0)
 Q
"RTN","PXVP210",9,0)
PRE ; pre-install entry for patch px*1*210
"RTN","PXVP210",10,0)
 ; delete AHR1 and AHR2 x-refs from V IMMUNIZATION file if they exist
"RTN","PXVP210",11,0)
 K DIK,DA S DIK="^DD(9000010.11,1201,1,",DA=2,DA(1)=1201,DA(2)=9000010.11 D ^DIK ; AHR1
"RTN","PXVP210",12,0)
 K DIK,DA S DIK="^DD(9000010.11,1403,1,",DA=2,DA(1)=1403,DA(2)=9000010.11 D ^DIK ; AHR2
"RTN","PXVP210",13,0)
 ; delete AHR1 and AHR2 x-refs from V SKIN TEST file if they exist
"RTN","PXVP210",14,0)
 K DIK,DA S DIK="^DD(9000010.12,.06,1,",DA=2,DA(1)=.06,DA(2)=9000010.12 D ^DIK ; AHR2
"RTN","PXVP210",15,0)
 K DIK,DA S DIK="^DD(9000010.12,1201,1,",DA=2,DA(1)=1201,DA(2)=9000010.12 D ^DIK ; AHR1
"RTN","PXVP210",16,0)
 ; delete AU, AU1 and AU2 x-refs from IMMUNIZATION LOT file if they exist
"RTN","PXVP210",17,0)
 K DIK,DA S DIK="^DD(9999999.41,.01,1,",DA=2,DA(1)=.01,DA(2)=9999999.41 D ^DIK ; AU
"RTN","PXVP210",18,0)
 K DIK,DA S DIK="^DD(9999999.41,.02,1,",DA=1,DA(1)=.02,DA(2)=9999999.41 D ^DIK ; AU1
"RTN","PXVP210",19,0)
 K DIK,DA S DIK="^DD(9999999.41,.04,1,",DA=2,DA(1)=.04,DA(2)=9999999.41 D ^DIK ; AU2
"RTN","PXVP210",20,0)
 Q
"RTN","PXVP210",21,0)
 ;
"RTN","PXVP210",22,0)
POST ; KIDS Post install for PX*1*210
"RTN","PXVP210",23,0)
 D BMES("*** Post install started ***")
"RTN","PXVP210",24,0)
 ;
"RTN","PXVP210",25,0)
 D CVIMMXR ; Update ACR cross-reference on V IMMUNIZATION file
"RTN","PXVP210",26,0)
 D CIMMXR ; Create ACR cross-reference on IMMUNIZATION file
"RTN","PXVP210",27,0)
 D BLDVIMM ; Rebuild Clinical Reminder index on V Immunization file
"RTN","PXVP210",28,0)
 D DDSEC ; Update DD security on Immunization and Skin Test files
"RTN","PXVP210",29,0)
 D TSKDSG ; Task job to split Dosage into Dose and Units
"RTN","PXVP210",30,0)
 D MVDIAGS ; Move diagnosis data from old fields to new fields
"RTN","PXVP210",31,0)
 ;
"RTN","PXVP210",32,0)
 D BMES("*** Post install completed ***")
"RTN","PXVP210",33,0)
 Q
"RTN","PXVP210",34,0)
 ;
"RTN","PXVP210",35,0)
CVIMMXR ; Update ACR cross-reference on V IMMUNIZATION file
"RTN","PXVP210",36,0)
 N PXERR,PXXR,PXRES
"RTN","PXVP210",37,0)
 ;
"RTN","PXVP210",38,0)
 D BMES("*** Updating ACR cross-reference on V IMMUNIZATION file ***")
"RTN","PXVP210",39,0)
 ;
"RTN","PXVP210",40,0)
 S PXXR("FILE")=9000010.11
"RTN","PXVP210",41,0)
 S PXXR("NAME")="ACR"
"RTN","PXVP210",42,0)
 S PXXR("TYPE")="MU"
"RTN","PXVP210",43,0)
 S PXXR("USE")="A"
"RTN","PXVP210",44,0)
 S PXXR("EXECUTION")="R"
"RTN","PXVP210",45,0)
 S PXXR("ACTIVITY")="IR"
"RTN","PXVP210",46,0)
 S PXXR("SHORT DESCR")="Clinical Reminders index."
"RTN","PXVP210",47,0)
 S PXXR("DESCR",1)="This cross-reference builds four indexes, two for finding all patients"
"RTN","PXVP210",48,0)
 S PXXR("DESCR",2)="with a particular immunization and two for finding all the immunizations a"
"RTN","PXVP210",49,0)
 S PXXR("DESCR",3)="patient has. "
"RTN","PXVP210",50,0)
 S PXXR("DESCR",4)="The indexes are stored in the Clinical Reminders index global as:"
"RTN","PXVP210",51,0)
 S PXXR("DESCR",5)="^PXRMINDX(9000010.11,""IP"",IMMUNIZATION,DFN,DATE,DAS)"
"RTN","PXVP210",52,0)
 S PXXR("DESCR",6)="^PXRMINDX(9000010.11,""CVX"",""IP"",CVX CODE,DFN,DATE,DAS) "
"RTN","PXVP210",53,0)
 S PXXR("DESCR",7)="and"
"RTN","PXVP210",54,0)
 S PXXR("DESCR",8)="^PXRMINDX(9000010.11,""PI"",DFN,IMMUNIZATION,DATE,DAS) "
"RTN","PXVP210",55,0)
 S PXXR("DESCR",9)="^PXRMINDX(9000010.11,""CVX"",""PI"",DFN,CVX CODE,DATE,DAS) "
"RTN","PXVP210",56,0)
 S PXXR("DESCR",10)="respectively. "
"RTN","PXVP210",57,0)
 S PXXR("DESCR",11)="For all the details, see the Clinical Reminders Index Technical"
"RTN","PXVP210",58,0)
 S PXXR("DESCR",12)="Guide/Programmer's Manual."
"RTN","PXVP210",59,0)
 S PXXR("SET")="D SVFILE^PXPXRM(9000010.11,.X,.DA)"
"RTN","PXVP210",60,0)
 S PXXR("KILL")="D KVFILE^PXPXRM(9000010.11,.X,.DA)"
"RTN","PXVP210",61,0)
 S PXXR("WHOLE KILL")="K ^PXRMINDX(9000010.11)"
"RTN","PXVP210",62,0)
 S PXXR("VAL",1)=.01
"RTN","PXVP210",63,0)
 S PXXR("VAL",1,"SUBSCRIPT")=1
"RTN","PXVP210",64,0)
 S PXXR("VAL",1,"COLLATION")="F"
"RTN","PXVP210",65,0)
 S PXXR("VAL",2)=.02
"RTN","PXVP210",66,0)
 S PXXR("VAL",2,"SUBSCRIPT")=2
"RTN","PXVP210",67,0)
 S PXXR("VAL",2,"COLLATION")="F"
"RTN","PXVP210",68,0)
 S PXXR("VAL",3)=.03
"RTN","PXVP210",69,0)
 S PXXR("VAL",3,"SUBSCRIPT")=3
"RTN","PXVP210",70,0)
 S PXXR("VAL",3,"COLLATION")="F"
"RTN","PXVP210",71,0)
 S PXXR("VAL",4)=1201
"RTN","PXVP210",72,0)
 S PXXR("VAL",4,"COLLATION")="F"
"RTN","PXVP210",73,0)
 D CREIXN^DDMOD(.PXXR,"k",.PXRES,,"PXERR")
"RTN","PXVP210",74,0)
 I $G(PXRES) D
"RTN","PXVP210",75,0)
 . D MES("Cross-reference "_$P(PXRES,U,2)_" (#"_$P(PXRES,U,1)_") was updated successfully.")
"RTN","PXVP210",76,0)
 I $G(PXRES)="" D
"RTN","PXVP210",77,0)
 . D MES("*** ERROR: Failed to update cross-reference. ***")
"RTN","PXVP210",78,0)
 Q
"RTN","PXVP210",79,0)
 ;
"RTN","PXVP210",80,0)
CIMMXR ; Create ACR cross-reference on IMMUNIZATION file
"RTN","PXVP210",81,0)
 N PXERR,PXXR,PXRES
"RTN","PXVP210",82,0)
 ;
"RTN","PXVP210",83,0)
 D BMES("*** Creating ACR cross-reference on IMMUNIZATION file ***")
"RTN","PXVP210",84,0)
 ;
"RTN","PXVP210",85,0)
 S PXXR("FILE")=9999999.14
"RTN","PXVP210",86,0)
 S PXXR("NAME")="ACR"
"RTN","PXVP210",87,0)
 S PXXR("TYPE")="MU"
"RTN","PXVP210",88,0)
 S PXXR("USE")="A"
"RTN","PXVP210",89,0)
 S PXXR("EXECUTION")="R"
"RTN","PXVP210",90,0)
 S PXXR("ACTIVITY")=""
"RTN","PXVP210",91,0)
 S PXXR("SHORT DESCR")="Updates Clinical Reminder's index when CVX code changes."
"RTN","PXVP210",92,0)
 S PXXR("DESCR",1)="This cross-reference updates the Clinical Reminder's index on the V"
"RTN","PXVP210",93,0)
 S PXXR("DESCR",2)="Immunization file when a CVX code changes for an immunization. The indexes"
"RTN","PXVP210",94,0)
 S PXXR("DESCR",3)="updated are:"
"RTN","PXVP210",95,0)
 S PXXR("DESCR",4)="^PXRMINDX(9000010.11,""CVX"",""IP"",CVX CODE,DFN,DATE,DAS) and"
"RTN","PXVP210",96,0)
 S PXXR("DESCR",5)="^PXRMINDX(9000010.11,""CVX"",""PI"",DFN,CVX CODE,DATE,DAS)."
"RTN","PXVP210",97,0)
 S PXXR("SET")="Q"
"RTN","PXVP210",98,0)
 S PXXR("KILL")="D UPDCVX^PXPXRM(.DA,X1(1),X2(1))"
"RTN","PXVP210",99,0)
 S PXXR("VAL",1)=.03
"RTN","PXVP210",100,0)
 S PXXR("VAL",1,"COLLATION")="F"
"RTN","PXVP210",101,0)
 D CREIXN^DDMOD(.PXXR,"k",.PXRES,,"PXERR")
"RTN","PXVP210",102,0)
 I $G(PXRES) D
"RTN","PXVP210",103,0)
 . D MES("Cross-reference "_$P(PXRES,U,2)_" (#"_$P(PXRES,U,1)_") was created successfully.")
"RTN","PXVP210",104,0)
 I $G(PXRES)="" D
"RTN","PXVP210",105,0)
 . D MES("*** ERROR: Failed to create cross-reference. ***")
"RTN","PXVP210",106,0)
 Q
"RTN","PXVP210",107,0)
 ;
"RTN","PXVP210",108,0)
BLDVIMM ; Rebuild Clinical Reminder index on V Immunization file
"RTN","PXVP210",109,0)
 N PXDESC,PXFILELIST,PXQDT,PXRTN,PXTASK,PXVOTH
"RTN","PXVP210",110,0)
 N ZTCPU,ZTDESC,ZTDTH,ZTIO,ZTKIL,ZTPRI,ZTRTN,ZTSAVE,ZTSK,ZTSYNC,ZTUCI
"RTN","PXVP210",111,0)
 ;
"RTN","PXVP210",112,0)
 D BMES("*** Task job to rebuild the Clinical Reminders index for V IMMUNIZATION ***")
"RTN","PXVP210",113,0)
 ;
"RTN","PXVP210",114,0)
 I $D(^PXRMINDX(9000010.11,"CVX")) D  Q  ;IA 4290
"RTN","PXVP210",115,0)
 . D MES("The index has already been rebuilt by previous installation.")
"RTN","PXVP210",116,0)
 . D MES("No need to rebuild it again.")
"RTN","PXVP210",117,0)
 ;
"RTN","PXVP210",118,0)
 S PXQDT=$G(XPDQUES("POS1"))
"RTN","PXVP210",119,0)
 I 'PXQDT S PXQDT=$$NOW^XLFDT
"RTN","PXVP210",120,0)
 ;
"RTN","PXVP210",121,0)
 I $T(BLDINDEX^PXRMSXRM)'="" D
"RTN","PXVP210",122,0)
 . S PXFILELIST(9000010.11)=""
"RTN","PXVP210",123,0)
 . S PXTASK=$$BLDINDEX^PXRMSXRM(.PXFILELIST,PXQDT) ;TODO: subscribe to ICR 6210
"RTN","PXVP210",124,0)
 I $T(BLDINDEX^PXRMSXRM)="" D
"RTN","PXVP210",125,0)
 . S PXRTN="BLDVIMMT^PXVP210"
"RTN","PXVP210",126,0)
 . S PXDESC="Clinical Reminders index rebuild for V IMMUNIZATION"
"RTN","PXVP210",127,0)
 . S PXVOTH("ZTDTH")=PXQDT
"RTN","PXVP210",128,0)
 . S PXTASK=$$NODEV^XUTMDEVQ(PXRTN,PXDESC,,.PXVOTH)
"RTN","PXVP210",129,0)
 ;
"RTN","PXVP210",130,0)
 I $G(PXTASK)>0 D MES("Task number "_PXTASK_" queued.")
"RTN","PXVP210",131,0)
 I $G(PXTASK)=-1 D  Q
"RTN","PXVP210",132,0)
 . D MES("*** ERROR: Task failed to queue ***")
"RTN","PXVP210",133,0)
 Q
"RTN","PXVP210",134,0)
 ;
"RTN","PXVP210",135,0)
BLDVIMMT ; Queued entry point to rebuild index
"RTN","PXVP210",136,0)
 S ZTREQ="@"
"RTN","PXVP210",137,0)
 D VIMM^PXPXRMI1
"RTN","PXVP210",138,0)
 D INDEXD^PXRMDIEV(9000010.11) ; IA 6059 ;TODO: subscribe to ICR 6059
"RTN","PXVP210",139,0)
 Q
"RTN","PXVP210",140,0)
 ;
"RTN","PXVP210",141,0)
DDSEC ; Update security access codes on Immunization and Skin Test files
"RTN","PXVP210",142,0)
 N PXFILENUM,PXSEC
"RTN","PXVP210",143,0)
 ;
"RTN","PXVP210",144,0)
 D BMES("*** Updating security access codes on Immunization and Skin Test files ***")
"RTN","PXVP210",145,0)
 ;
"RTN","PXVP210",146,0)
 S PXSEC("AUDIT")="@"
"RTN","PXVP210",147,0)
 S PXSEC("DD")="@"
"RTN","PXVP210",148,0)
 S PXSEC("DEL")="@"
"RTN","PXVP210",149,0)
 S PXSEC("LAYGO")="@"
"RTN","PXVP210",150,0)
 S PXSEC("RD")=""
"RTN","PXVP210",151,0)
 S PXSEC("WR")="@"
"RTN","PXVP210",152,0)
 ;
"RTN","PXVP210",153,0)
 F PXFILENUM=9999999.14,9999999.28 D
"RTN","PXVP210",154,0)
 . D FILESEC^DDMOD(PXFILENUM,.PXSEC)
"RTN","PXVP210",155,0)
 Q
"RTN","PXVP210",156,0)
 ;
"RTN","PXVP210",157,0)
TSKDSG ; Task job to split Dosage into Dose and Units
"RTN","PXVP210",158,0)
 N PXRTN,PXDESC,PXVOTH,PXTASK
"RTN","PXVP210",159,0)
 ;
"RTN","PXVP210",160,0)
 D BMES("*** Task job to split V Immunization DOSAGE field (#1312) ***")
"RTN","PXVP210",161,0)
 I $G(^XTMP("PXVP210","DOSAGE")) D  Q
"RTN","PXVP210",162,0)
 . D MES("The Dosage has already been split by previous installation.")
"RTN","PXVP210",163,0)
 . D MES("No need to do it again.")
"RTN","PXVP210",164,0)
 ;
"RTN","PXVP210",165,0)
 S PXRTN="DOSAGE^PXVP210"
"RTN","PXVP210",166,0)
 S PXDESC="Split V Immunization DOSAGE field (1312)"
"RTN","PXVP210",167,0)
 S PXVOTH("ZTDTH")=$H
"RTN","PXVP210",168,0)
 S PXTASK=$$NODEV^XUTMDEVQ(PXRTN,PXDESC,,.PXVOTH)
"RTN","PXVP210",169,0)
 ;
"RTN","PXVP210",170,0)
 I $G(PXTASK)>0 D MES("Task number "_PXTASK_" queued.")
"RTN","PXVP210",171,0)
 I $G(PXTASK)=-1 D  Q
"RTN","PXVP210",172,0)
 . D MES("*** ERROR: Task failed to queue ***")
"RTN","PXVP210",173,0)
 Q
"RTN","PXVP210",174,0)
 ;
"RTN","PXVP210",175,0)
DOSAGE ; Loop through all V Immunization records and determine if Dosage needs to be split
"RTN","PXVP210",176,0)
 S ZTREQ="@"
"RTN","PXVP210",177,0)
 ;
"RTN","PXVP210",178,0)
 N PX13,PXIEN,PXVPDT
"RTN","PXVP210",179,0)
 ;
"RTN","PXVP210",180,0)
 S PXIEN=0
"RTN","PXVP210",181,0)
 F  S PXIEN=$O(^AUPNVIMM(PXIEN)) Q:'PXIEN  D
"RTN","PXVP210",182,0)
 . S PX13=$G(^AUPNVIMM(PXIEN,13))
"RTN","PXVP210",183,0)
 . I $P(PX13,U,12)'="",$P(PX13,U,13)="" D SPLITDSG(PXIEN)
"RTN","PXVP210",184,0)
 ;
"RTN","PXVP210",185,0)
 ; Set dosage flag in XTMP so that we know that the dosage split was completed
"RTN","PXVP210",186,0)
 S PXVPDT=$$FMADD^XLFDT(DT,365)
"RTN","PXVP210",187,0)
 S ^XTMP("PXVP210",0)=PXVPDT_"^"_DT
"RTN","PXVP210",188,0)
 S ^XTMP("PXVP210","DOSAGE")=1
"RTN","PXVP210",189,0)
 Q
"RTN","PXVP210",190,0)
 ;
"RTN","PXVP210",191,0)
SPLITDSG(PXIEN) ; Split Dosage field
"RTN","PXVP210",192,0)
 N PXFILE,PXIENS,PXDOSAGE,PXDOSE,PXUNITS,PXDELIM,PXFDAE,PXFDAI,PXVALID,PXCOM
"RTN","PXVP210",193,0)
 ;
"RTN","PXVP210",194,0)
 S PXFILE=9000010.11
"RTN","PXVP210",195,0)
 S PXIENS=PXIEN_","
"RTN","PXVP210",196,0)
 S PXDOSAGE=$P($G(^AUPNVIMM(PXIEN,13)),U,12)
"RTN","PXVP210",197,0)
 S PXDOSAGE=$$TRIM^XLFSTR(PXDOSAGE)
"RTN","PXVP210",198,0)
 S (PXDOSE,PXUNITS)=""
"RTN","PXVP210",199,0)
 ;
"RTN","PXVP210",200,0)
 S PXDELIM=" "
"RTN","PXVP210",201,0)
 I PXDOSAGE[";" S PXDELIM=";"
"RTN","PXVP210",202,0)
 ;
"RTN","PXVP210",203,0)
 S PXDOSE=$P(PXDOSAGE,PXDELIM,1)
"RTN","PXVP210",204,0)
 S PXUNITS=$P(PXDOSAGE,PXDELIM,2)
"RTN","PXVP210",205,0)
 ;
"RTN","PXVP210",206,0)
 K PXFDAE,PXFDAI
"RTN","PXVP210",207,0)
 S PXFDAE(PXFILE,PXIENS,1312)=PXDOSE
"RTN","PXVP210",208,0)
 S PXFDAE(PXFILE,PXIENS,1313)=PXUNITS
"RTN","PXVP210",209,0)
 D VALS^DIE("","PXFDAE","PXFDAI")
"RTN","PXVP210",210,0)
 S PXVALID=0
"RTN","PXVP210",211,0)
 I $G(PXFDAI(PXFILE,PXIENS,1312))'="^",$G(PXFDAI(PXFILE,PXIENS,1313))'="^" S PXVALID=1
"RTN","PXVP210",212,0)
 I PXVALID D FILE^DIE("K","PXFDAI")
"RTN","PXVP210",213,0)
 I 'PXVALID D
"RTN","PXVP210",214,0)
 . S PXCOM=$G(^AUPNVIMM(PXIEN,811))
"RTN","PXVP210",215,0)
 . S PXCOM=$S(PXCOM'="":PXCOM_"; ",1:"")_"Dosage: "_$TR(PXDOSAGE,";"," ")
"RTN","PXVP210",216,0)
 . K PXFDAI
"RTN","PXVP210",217,0)
 . S PXFDAI(PXFILE,PXIENS,1312)="@"
"RTN","PXVP210",218,0)
 . S PXFDAI(PXFILE,PXIENS,81101)=PXCOM
"RTN","PXVP210",219,0)
 . D FILE^DIE("KET","PXFDAI")
"RTN","PXVP210",220,0)
 Q
"RTN","PXVP210",221,0)
 ;
"RTN","PXVP210",222,0)
MVDIAGS ;
"RTN","PXVP210",223,0)
 ; move the data in the old DIAGNOSIS fields of the V SKIN TEST file
"RTN","PXVP210",224,0)
 ; (#9000010.12) to the new fields:
"RTN","PXVP210",225,0)
 ; from old fields .08, .09, .1, .11, .12, .13, .14, .15
"RTN","PXVP210",226,0)
 ;   to new fields 801, 802, 803, 804, 805, 806, 807, 808 respectively.
"RTN","PXVP210",227,0)
 ;
"RTN","PXVP210",228,0)
 I $$GET1^DID(9000010.12,.08,"","LABEL")'="DIAGNOSIS" Q  ; Quit if DIAGNOSIS field (#.08) does not exist
"RTN","PXVP210",229,0)
 N %,CNT,DA,DIK,DR,J,Q,X,Y,PXVD,PXVNOW,PXVV
"RTN","PXVP210",230,0)
 D NOW^%DTC S Y=% D DD^%DT S PXVNOW=Y
"RTN","PXVP210",231,0)
 K Q S Q(1)=" ",Q(2)="*** Moving V SKIN TEST file DIAGNOSIS data to new fields."
"RTN","PXVP210",232,0)
 S Q(3)="                       Process started "_PXVNOW_" ***"
"RTN","PXVP210",233,0)
 D BMES^XPDUTL(.Q)
"RTN","PXVP210",234,0)
 S (CNT,PXVV)=0
"RTN","PXVP210",235,0)
 F  S PXVV=$O(^AUPNVSK(PXVV)) Q:'PXVV  S PXVD=$P($G(^(PXVV,0)),"^",8,15) I PXVD'="",PXVD'="^^^^^^^" D
"RTN","PXVP210",236,0)
 . S:'$D(^AUPNVSK(PXVV,80)) ^AUPNVSK(PXVV,80)=PXVD,CNT=CNT+1
"RTN","PXVP210",237,0)
 . F J=8:1:15 S $P(^AUPNVSK(PXVV,0),"^",J)="" ; set diagnosis field values to null
"RTN","PXVP210",238,0)
 ;
"RTN","PXVP210",239,0)
MVDONE ; DIAGNOSIS data move completed
"RTN","PXVP210",240,0)
 D NOW^%DTC S Y=% D DD^%DT S PXVNOW=Y
"RTN","PXVP210",241,0)
 K Q S Q(1)=" ",Q(3)=" "_CNT_" entr"_$S(CNT'=1:"ies",1:"y")_" processed."
"RTN","PXVP210",242,0)
 S Q(2)="*** Process moving DIAGNOSIS data completed at "_PXVNOW_" ***"
"RTN","PXVP210",243,0)
 D BMES^XPDUTL(.Q)
"RTN","PXVP210",244,0)
 ;
"RTN","PXVP210",245,0)
RMVFLD ; remove DDs for old diagnosis fields .08 to .15
"RTN","PXVP210",246,0)
 N PXF,PXJ,PXN S PXJ=1
"RTN","PXVP210",247,0)
 S PXF="DIAGNOSIS",PXN=.08 D DELFLD
"RTN","PXVP210",248,0)
 F PXN=.09:.01:.15 S PXJ=PXJ+1,PXF="DIAGNOSIS "_PXJ D DELFLD
"RTN","PXVP210",249,0)
 Q
"RTN","PXVP210",250,0)
DELFLD ; delete field if it exists
"RTN","PXVP210",251,0)
 I $$GET1^DID(9000010.12,PXN,"","LABEL")=PXF D
"RTN","PXVP210",252,0)
 . D BMES^XPDUTL("***  Deleting field "_PXN_" ***")
"RTN","PXVP210",253,0)
 . K DIK,DA S DIK="^DD(9000010.12,",DA=PXN,DA(1)=9000010.12 D ^DIK
"RTN","PXVP210",254,0)
 Q
"RTN","PXVP210",255,0)
 ;
"RTN","PXVP210",256,0)
BMES(STR) ;
"RTN","PXVP210",257,0)
 ; Write string
"RTN","PXVP210",258,0)
 D BMES^XPDUTL($$TRIM^XLFSTR($$CJ^XLFSTR(STR,$G(IOM,80)),"R"," "))
"RTN","PXVP210",259,0)
 Q
"RTN","PXVP210",260,0)
MES(STR) ;
"RTN","PXVP210",261,0)
 ; Write string
"RTN","PXVP210",262,0)
 D MES^XPDUTL($$TRIM^XLFSTR($$CJ^XLFSTR(STR,$G(IOM,80)),"R"," "))
"RTN","PXVP210",263,0)
 Q
"RTN","PXVUTIL")
0^27^B5632324^B3032993
"RTN","PXVUTIL",1,0)
PXVUTIL ;BIR/ADM - VIMM UTILITY ROUTINE ;08/20/15
"RTN","PXVUTIL",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**201,210**;Aug 12, 1996;Build 11
"RTN","PXVUTIL",3,0)
 ;
"RTN","PXVUTIL",4,0)
VIS ; display VIS name with identifiers
"RTN","PXVUTIL",5,0)
 N C,PXVNAME,PXVDATE,PXVSTAT,PXVLANG,X
"RTN","PXVUTIL",6,0)
 S X=$G(^AUTTIVIS(Y,0))
"RTN","PXVUTIL",7,0)
 S PXVNAME=$P(X,"^"),PXVDATE=$P(X,"^",2),PXVSTAT=$P(X,"^",3),PXVLANG=$P(X,"^",4)
"RTN","PXVUTIL",8,0)
 S X=PXVDATE,PXVDATE=$E(X,4,5)_"-"_$E(X,6,7)_"-"_$E(X,2,3)
"RTN","PXVUTIL",9,0)
 S Y=PXVSTAT,C=$P(^DD(920,.03,0),"^",2) D:Y'="" Y^DIQ S PXVSTAT=Y
"RTN","PXVUTIL",10,0)
 S Y=PXVLANG,C=$P(^DD(920,.04,0),"^",2) D:Y'="" Y^DIQ S PXVLANG=Y
"RTN","PXVUTIL",11,0)
 S Y=PXVNAME_"   "_PXVDATE_"   "_PXVSTAT_"   "_PXVLANG
"RTN","PXVUTIL",12,0)
 Q
"RTN","PXVUTIL",13,0)
 ;;
"RTN","PXVUTIL",14,0)
DUPDX(PXVIEN,PXVDX) ; extrinsic function to check for duplicate diagnoses
"RTN","PXVUTIL",15,0)
 ; PXVIEN - Internal Entry Number of the event, pointing to the
"RTN","PXVUTIL",16,0)
 ;        V IMMUNIZATION file (9000010.11)
"RTN","PXVUTIL",17,0)
 ; PXVDX is the diagnosis entered and used to check for duplicates
"RTN","PXVUTIL",18,0)
 ; 
"RTN","PXVUTIL",19,0)
 ; this code is called by the input transforms of:
"RTN","PXVUTIL",20,0)
 ;        ^DD(9000010.11,1304,0) & ^DD(9000010.113,.01,0)
"RTN","PXVUTIL",21,0)
 ; 
"RTN","PXVUTIL",22,0)
 ; RETURNS a 1 if the diagnosis already exists for this
"RTN","PXVUTIL",23,0)
 ;         entry, 0 if not
"RTN","PXVUTIL",24,0)
 ;
"RTN","PXVUTIL",25,0)
 N TXT K TXT S TXT(2)=" ",TXT(1,"F")="?5"
"RTN","PXVUTIL",26,0)
 I PXVDX=$P($G(^AUPNVIMM(PXVIEN,13)),"^",4) S TXT(1)="Selected diagnosis exists as the Primary Diagnosis for this event." D EN^DDIOL(.TXT,"","") Q 1
"RTN","PXVUTIL",27,0)
 I $D(^AUPNVIMM(PXVIEN,3,"B",PXVDX)) S TXT(1)="Selected diagnosis exists for this event." D EN^DDIOL(.TXT,"","") Q 1
"RTN","PXVUTIL",28,0)
 Q 0
"RTN","PXVUTIL",29,0)
 ;;
"RTN","PXVUTIL",30,0)
RSETDA ; code needed for the routine AUPNSICD to have the correct value in
"RTN","PXVUTIL",31,0)
 ;   DA, as AUPNSICD is not designed to be called from a multiple.
"RTN","PXVUTIL",32,0)
 N DA S DA=D0
"RTN","PXVUTIL",33,0)
 D ^AUPNSICD
"RTN","PXVUTIL",34,0)
 Q
"RTN","PXVUTIL",35,0)
HRS ; called by AH new style x-ref in V IMMUNIZATION file
"RTN","PXVUTIL",36,0)
 ; set number of hours between administration and reading of results
"RTN","PXVUTIL",37,0)
 N PXVX,X1,X2,X3
"RTN","PXVUTIL",38,0)
 S X1=$P($G(^AUPNVIMM(DA,14)),"^",3) ; DATE/TIME READ
"RTN","PXVUTIL",39,0)
 S X2=$P($G(^AUPNVIMM(DA,12)),"^") ; EVENT DATE AND TIME
"RTN","PXVUTIL",40,0)
 S X3=2 ; return difference in seconds
"RTN","PXVUTIL",41,0)
 S PXVX=""
"RTN","PXVUTIL",42,0)
 I $G(X1),$L(X1)>7,$G(X2),$L(X2)>7,$G(X2)'>$G(X1) S PXVX=$$FMDIFF^XLFDT(X1,X2,X3)\3600
"RTN","PXVUTIL",43,0)
 S $P(^AUPNVIMM(DA,14),"^",6)=PXVX
"RTN","PXVUTIL",44,0)
 Q
"RTN","PXVUTIL",45,0)
 ;
"RTN","PXVUTIL",46,0)
DOSAGE(PXIEN) ; Used to compute Dosage (9000010.11,1312.5)
"RTN","PXVUTIL",47,0)
 ;Input:
"RTN","PXVUTIL",48,0)
 ;   PXIEN = (Required) Pointer to #9000010.11
"RTN","PXVUTIL",49,0)
 ;Returns:
"RTN","PXVUTIL",50,0)
 ;   Concatenation of DOSE_" "_DOSE UNITS (e.g., ".5 mL")
"RTN","PXVUTIL",51,0)
 N PXDOSE,PXUNITS
"RTN","PXVUTIL",52,0)
 I $G(PXIEN)="" Q ""
"RTN","PXVUTIL",53,0)
 S PXDOSE=$P($G(^AUPNVIMM(PXIEN,13)),U,12)
"RTN","PXVUTIL",54,0)
 I PXDOSE="" Q ""
"RTN","PXVUTIL",55,0)
 S PXDOSE=$FN(PXDOSE,",")
"RTN","PXVUTIL",56,0)
 S PXUNITS=$P($G(^AUPNVIMM(PXIEN,13)),U,13)
"RTN","PXVUTIL",57,0)
 I PXUNITS S PXUNITS=$P($$UCUMCODE^LEXMUCUM(PXUNITS),U)
"RTN","PXVUTIL",58,0)
 Q PXDOSE_$S(PXUNITS'="":" "_PXUNITS,1:"")
"RTN","PXVUTL")
0^22^B4415955^n/a
"RTN","PXVUTL",1,0)
PXVUTL ;BIR/ADM - SKIN TEST UTILITY ROUTINE ;08/20/2015
"RTN","PXVUTL",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXVUTL",3,0)
 ;
"RTN","PXVUTL",4,0)
HR ; called by AH new style x-ref in V SKIN TEST file
"RTN","PXVUTL",5,0)
 ; set number of hours between placement and reading of test
"RTN","PXVUTL",6,0)
 N PXVX,X1,X2,X3
"RTN","PXVUTL",7,0)
 S X1=$P($G(^AUPNVSK(DA,0)),"^",6) ; DATE READ
"RTN","PXVUTL",8,0)
 S X2=$P($G(^AUPNVSK(DA,12)),"^") ; EVENT DATE AND TIME
"RTN","PXVUTL",9,0)
 S X3=2 ; return difference in seconds
"RTN","PXVUTL",10,0)
 S PXVX=""
"RTN","PXVUTL",11,0)
 I $G(X1),$L(X1)>7,$G(X2),$L(X2)>7,$G(X2)'>$G(X1) S PXVX=$$FMDIFF^XLFDT(X1,X2,X3)\3600
"RTN","PXVUTL",12,0)
 S $P(^AUPNVSK(DA,12),"^",14)=PXVX
"RTN","PXVUTL",13,0)
 Q
"RTN","PXVUTL",14,0)
CODSYS ; set logic for AC x-ref on SKIN TEST field to populate CODE SYSTEM multiple
"RTN","PXVUTL",15,0)
 N PXVCODE,PXVSK,PXVTN
"RTN","PXVUTL",16,0)
 S PXVCODE=$$CODX(X,DA)
"RTN","PXVUTL",17,0)
 Q
"RTN","PXVUTL",18,0)
CODX(PXVSK,PXVTN) ; populate CODE SYSTEM multiple
"RTN","PXVUTL",19,0)
 N DA,DD,DO,DIC,DR,PXVC,PXVCOD,PXVIEN,PXVM,PXVSYS,X S PXVCODE=0
"RTN","PXVUTL",20,0)
 S PXVM=0 F  S PXVM=$O(^AUTTSK(PXVSK,3,PXVM)) Q:'PXVM  D
"RTN","PXVUTL",21,0)
 .S PXVSYS=$P(^AUTTSK(PXVSK,3,PXVM,0),"^") Q:PXVSYS=""  S PXVCODE=1
"RTN","PXVUTL",22,0)
 .K DA,DD,DO,DIC S DA(1)=PXVTN,DIC="^AUPNVSK(PXVTN,3,",DIC(0)="L",X=PXVSYS D FILE^DICN K DA,DD,DIC,DO,DR S PXVIEN=+Y I PXVIEN'>0 S PXVCODE=0 Q
"RTN","PXVUTL",23,0)
 .S PXVC=0 F  S PXVC=$O(^AUTTSK(PXVSK,3,PXVM,1,PXVC)) Q:'PXVC  D
"RTN","PXVUTL",24,0)
 ..S PXVCOD=$P(^AUTTSK(PXVSK,3,PXVM,1,PXVC,0),"^")
"RTN","PXVUTL",25,0)
 ..S PXVY(9000010.1231,"+1,"_PXVIEN_","_PXVTN_",",.01)=PXVCOD D UPDATE^DIE("","PXVY") K PXVY
"RTN","PXVUTL",26,0)
 Q PXVCODE
"RTN","PXVUTL",27,0)
KCODSYS ; kill logic for AC x-ref
"RTN","PXVUTL",28,0)
 N PXVCODE,PXVTN
"RTN","PXVUTL",29,0)
 S PXVCODE=$$KCODX(DA)
"RTN","PXVUTL",30,0)
 Q
"RTN","PXVUTL",31,0)
KCODX(PXVTN) ;
"RTN","PXVUTL",32,0)
 N DA,DD,DO,DIC,DR,PXVJ S PXVCODE=0
"RTN","PXVUTL",33,0)
 S PXVJ=0 F  S PXVJ=$O(^AUPNVSK(PXVTN,3,PXVJ)) Q:'PXVJ  D  S PXVCODE=1
"RTN","PXVUTL",34,0)
 .S PXVY(9000010.123,PXVJ_","_PXVTN_",",.01)="@" D FILE^DIE("","PXVY")
"RTN","PXVUTL",35,0)
 Q PXVCODE
"RTN","PXVUTL",36,0)
TIME() ; determine if future time
"RTN","PXVUTL",37,0)
 N PXV,PXVX,PXVY S PXVX=X,PXV=0
"RTN","PXVUTL",38,0)
 D NOW I PXVX>PXVY S PXV=1
"RTN","PXVUTL",39,0)
 Q PXV
"RTN","PXVUTL",40,0)
NOW ; get now for comparison
"RTN","PXVUTL",41,0)
 N %,%H,%I,X
"RTN","PXVUTL",42,0)
 D NOW^%DTC S PXVY=$E(%,1,12)
"RTN","PXVUTL",43,0)
 Q 
"RTN","PXVXR")
0^23^B12103337^n/a
"RTN","PXVXR",1,0)
PXVXR ;BIR/ADM - CROSS REFERENCE AND OTHER LOGIC ;08/24/2015
"RTN","PXVXR",2,0)
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**210**;Aug 12, 1996;Build 11
"RTN","PXVXR",3,0)
 ;
"RTN","PXVXR",4,0)
 Q
"RTN","PXVXR",5,0)
EXP ; check for expiration date in the past
"RTN","PXVXR",6,0)
 N PXVX,PXVDT,Y
"RTN","PXVXR",7,0)
 S PXVDT=X I PXVDT<DT D  Q
"RTN","PXVXR",8,0)
 .D EN^DDIOL(">>> The date entered is a past date. <<<","","!!?4") S PXVX=$C(7) D EN^DDIOL(PXVX,"","!")
"RTN","PXVXR",9,0)
 .K DIR S DIR("A")=" Are you sure you have entered the correct date",DIR(0)="Y",DIR("B")="NO" D ^DIR K DIR
"RTN","PXVXR",10,0)
 .I $D(DTOUT)!$D(DUOUT)!'Y K X Q
"RTN","PXVXR",11,0)
 .S X=PXVDT
"RTN","PXVXR",12,0)
 Q
"RTN","PXVXR",13,0)
INUSE ; input check on LOT NUMBER field (#.01)
"RTN","PXVXR",14,0)
 N PXV,PXVIM,PXVLN,PXVMAN,PXVX
"RTN","PXVXR",15,0)
 I $D(^AUPNVIMM("LN",DA)) D  Q:'$D(X)
"RTN","PXVXR",16,0)
 .D EN^DDIOL("Lot Number already assigned and cannot be edited.","","!!?4")
"RTN","PXVXR",17,0)
 .S PXVX=$C(7) D EN^DDIOL(PXVX,"","!") K X
"RTN","PXVXR",18,0)
COMB ; check on LOT NUMBER field (#.01) for uniqueness of Immunization Name, Lot Number and Manufacturer combination
"RTN","PXVXR",19,0)
 S PXVLN=X
"RTN","PXVXR",20,0)
 S PXV=$G(^AUTTIML(DA,0)),PXVMAN=$P(PXV,"^",2),PXVIM=$P(PXV,"^",4) I PXVMAN=""!(PXVIM="") Q
"RTN","PXVXR",21,0)
AUCHK I $D(^AUTTIML("AU",PXVIM,PXVMAN,PXVLN)) D  Q
"RTN","PXVXR",22,0)
 .D EN^DDIOL("Immunization Name, Lot Number and Manufacturer combination must be unique.","","!!?4")
"RTN","PXVXR",23,0)
 .S PXVX=$C(7) D EN^DDIOL(PXVX,"","!") K X
"RTN","PXVXR",24,0)
 Q
"RTN","PXVXR",25,0)
COMB1 ; input check on MANUFACTURER field (#.02)
"RTN","PXVXR",26,0)
 N PXV,PXVIM,PXVLN,PXVMAN,PXVX
"RTN","PXVXR",27,0)
 S PXVMAN=X
"RTN","PXVXR",28,0)
 S PXV=$G(^AUTTIML(DA,0)),PXVLN=$P(PXV,"^"),PXVIM=$P(PXV,"^",4) I PXVLN=""!(PXVIM="") Q
"RTN","PXVXR",29,0)
 D AUCHK
"RTN","PXVXR",30,0)
 Q
"RTN","PXVXR",31,0)
COMB2 ; input check on VACCINE field (#.04)
"RTN","PXVXR",32,0)
 N PXV,PXVIM,PXVLN,PXVMAN,PXVX
"RTN","PXVXR",33,0)
 S PXVIM=X
"RTN","PXVXR",34,0)
 S PXV=$G(^AUTTIML(DA,0)),PXVLN=$P(PXV,"^"),PXVMAN=$P(PXV,"^",2) I PXVLN=""!(PXVMAN="") Q
"RTN","PXVXR",35,0)
 D AUCHK
"RTN","PXVXR",36,0)
 Q
"RTN","PXVXR",37,0)
ACT() ; screen immunization with active immunization lot number
"RTN","PXVXR",38,0)
 N PXVIMM,PXVVAC
"RTN","PXVXR",39,0)
 S PXVIMM=0 D  Q PXVIMM
"RTN","PXVXR",40,0)
 .I $D(DA),$D(^AUTTIML("C",$P(^AUPNVIMM(DA,0),U),Y)) S PXVIMM=1 Q
"RTN","PXVXR",41,0)
 .I $G(PXCEFIEN),$D(^AUTTIML("C",$P(^AUPNVIMM(PXCEFIEN,0),U),Y)) S PXVIMM=1 Q
"RTN","PXVXR",42,0)
 .I $D(PXD),$D(^AUTTIML("C",$P(PXD,"^"),Y)) S PXVIMM=1 Q
"RTN","PXVXR",43,0)
 Q
"RTN","PXVXR",44,0)
LOT() ;
"RTN","PXVXR",45,0)
 N PXVIMM,PXVLN
"RTN","PXVXR",46,0)
 S PXVIMM=0 D  Q PXVIMM
"RTN","PXVXR",47,0)
 .S PXVLN=0 F  S PXVLN=$O(^AUTTIML("C",Y,PXVLN)) Q:'PXVLN  I $P(^AUTTIML(PXVLN,0),"^",12)>0 S PXVIMM=1 Q
"RTN","PXVXR",48,0)
 Q
"RTN","PXVXR",49,0)
STOCK ; set logic for AC x-ref in V IMMUNIZATION file
"RTN","PXVXR",50,0)
 ; check for availability of selected immunization in immunization inventory
"RTN","PXVXR",51,0)
 N PXVIEN,PXVIMM,PXVLN,PXVSTOCK
"RTN","PXVXR",52,0)
 I $$HIST Q
"RTN","PXVXR",53,0)
 S PXVIEN=X,PXVLN=0,PXVSTOCK=0
"RTN","PXVXR",54,0)
 F  S PXVLN=$O(^AUTTIML("C",PXVIEN,PXVLN)) Q:'PXVLN  I $P(^AUTTIML(PXVLN,0),"^",12)>0 S PXVSTOCK=1 Q
"RTN","PXVXR",55,0)
 I 'PXVSTOCK S PXVIMM=$P(^AUTTIMM(PXVIEN,0),"^") D
"RTN","PXVXR",56,0)
 .D EN^DDIOL(">> No stock available for "_PXVIMM_"! <<",,"!!,?2")
"RTN","PXVXR",57,0)
 .D ALERT
"RTN","PXVXR",58,0)
 Q
"RTN","PXVXR",59,0)
HIST() ; check if historical encounter
"RTN","PXVXR",60,0)
 N PXVHIST,PXVSIT S PXVHIST=0 D  Q PXVHIST
"RTN","PXVXR",61,0)
 .I $G(DA),$P($G(^AUPNVIMM(DA,13)),"^")>1 S PXVHIST=1 Q
"RTN","PXVXR",62,0)
 .I $G(PXCEFIEN),$P($G(^AUPNVIMM(PXCEFIEN,13)),"^")>1 S PXVHIST=1 Q
"RTN","PXVXR",63,0)
 .I $G(PXCEVIEN),$P($G(^AUPNVSIT(PXCEVIEN,0)),"^",7)="E" S PXVHIST=1 Q
"RTN","PXVXR",64,0)
 .I '$G(PXCEVIEN),$G(PXCEFIEN) S PXVSIT=$P($G(^AUPNVIMM(PXCEFIEN,0)),"^",3) I $G(PXVSIT),$P($G(^AUPNVSIT(PXVSIT,0)),"^",7)="E" S PXVHIST=1
"RTN","PXVXR",65,0)
 Q
"RTN","PXVXR",66,0)
ALERT ; send alert if no stock available 
"RTN","PXVXR",67,0)
 N XQA,XQAMSG,PXVVAR
"RTN","PXVXR",68,0)
 S XQA(DUZ)=""
"RTN","PXVXR",69,0)
 S XQAMSG="No stock available for "_PXVIMM_"!"
"RTN","PXVXR",70,0)
 S PXVVAR=$$SETUP1^XQALERT
"RTN","PXVXR",71,0)
 Q
"RTN","PXVXR",72,0)
DECR ; set logic for AF x-ref in V IMMUNIZATION file
"RTN","PXVXR",73,0)
 ; decrement doses unused in IMMUNIZATION LOT file
"RTN","PXVXR",74,0)
 I $$HIST Q
"RTN","PXVXR",75,0)
 N PXV
"RTN","PXVXR",76,0)
 S PXV=$P($G(^AUTTIML(X,0)),"^",12) I 'PXV Q
"RTN","PXVXR",77,0)
 S PXV=PXV-1,$P(^AUTTIML(X,0),"^",12)=PXV
"RTN","PXVXR",78,0)
 Q
"RTN","PXVXR",79,0)
INCR ; kill logic for AF x-ref in V IMMUNIZATION file
"RTN","PXVXR",80,0)
 ; increment doses unused in IMMUNIZATION LOT file
"RTN","PXVXR",81,0)
 I $$HIST Q
"RTN","PXVXR",82,0)
 N PXV
"RTN","PXVXR",83,0)
 S PXV=$P($G(^AUTTIML(X,0)),"^",12) I PXV="" Q
"RTN","PXVXR",84,0)
 S PXV=PXV+1,$P(^AUTTIML(X,0),"^",12)=PXV
"RTN","PXVXR",85,0)
 Q
"SEC","^DD",9000010.11,9000010.11,1312.5,9)

"SEC","^DIC",9000010.11,9000010.11,0,"AUDIT")
@
"SEC","^DIC",9000010.11,9000010.11,0,"DD")
@
"SEC","^DIC",9000010.12,9000010.12,0,"DD")
@
"SEC","^DIC",9999999.41,9999999.41,0,"AUDIT")
@
"SEC","^DIC",9999999.41,9999999.41,0,"DD")
@
"SEC","^DIC",9999999.41,9999999.41,0,"DEL")
@
"SEC","^DIC",9999999.41,9999999.41,0,"LAYGO")
@
"SEC","^DIC",9999999.41,9999999.41,0,"RD")
@
"SEC","^DIC",9999999.41,9999999.41,0,"WR")
@
"VER")
8.0^22.0
"^DD",9000010.11,9000010.11,0)
FIELD^^1312.5^58
"^DD",9000010.11,9000010.11,0,"DDA")
N
"^DD",9000010.11,9000010.11,0,"DT")
3150820
"^DD",9000010.11,9000010.11,0,"ID",.02)
W "   ",$S($D(^DPT(+$P(^(0),U,2),0))#2:$P(^(0),U,1),1:""),@("$E("_DIC_"Y,0),0)")
"^DD",9000010.11,9000010.11,0,"ID",.03)
W "   " S AIHSY=Y,Y=$S($D(^AUPNVSIT(+$P(^(0),U,3),0))#2:$P(^(0),U,1),1:"") X:Y ^DD("DD") W Y S Y=AIHSY K AIHSY W @("$E("_DIC_"Y,0),0)")
"^DD",9000010.11,9000010.11,0,"IX","AA",9000010.11,.03)

"^DD",9000010.11,9000010.11,0,"IX","AATOO",9000010.11,.01)

"^DD",9000010.11,9000010.11,0,"IX","AATOO2",9000010.11,.02)

"^DD",9000010.11,9000010.11,0,"IX","AC",9000010.11,.01)

"^DD",9000010.11,9000010.11,0,"IX","AD",9000010.11,.03)

"^DD",9000010.11,9000010.11,0,"IX","AE",9000010.11,1402)

"^DD",9000010.11,9000010.11,0,"IX","AF",9000010.11,1207)

"^DD",9000010.11,9000010.11,0,"IX","AV10",9000010.11,.03)

"^DD",9000010.11,9000010.11,0,"IX","B",9000010.11,.01)

"^DD",9000010.11,9000010.11,0,"IX","C",9000010.11,.02)

"^DD",9000010.11,9000010.11,0,"IX","LN",9000010.11,1207)

"^DD",9000010.11,9000010.11,0,"NM","V IMMUNIZATION")
 
"^DD",9000010.11,9000010.11,0,"PT",9000010.11,1208)

"^DD",9000010.11,9000010.11,0,"VRPK")
PX
"^DD",9000010.11,9000010.11,.01,0)
IMMUNIZATION^R*P9999999.14'a^AUTTIMM(^0;1^S DIC("S")="I $P(^(0),U,7)'=1" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.11,9000010.11,.01,1,0)
^.1
"^DD",9000010.11,9000010.11,.01,1,1,0)
9000010.11^B
"^DD",9000010.11,9000010.11,.01,1,1,1)
S ^AUPNVIMM("B",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.11,.01,1,1,2)
K ^AUPNVIMM("B",$E(X,1,30),DA)
"^DD",9000010.11,9000010.11,.01,1,2,0)
^^TRIGGER^9000010.11^1206
"^DD",9000010.11,9000010.11,.01,1,2,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVIMM(D0,12)):^(12),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X=DIV S X=$G(DUZ) S DIH=$G(^AUPNVIMM(DIV(0),12)),DIV=X S $P(^(12),U,6)=DIV,DIH=9000010.11,DIG=1206 D ^DICR
"^DD",9000010.11,9000010.11,.01,1,2,2)
Q
"^DD",9000010.11,9000010.11,.01,1,2,"%D",0)
^^3^3^3140422^
"^DD",9000010.11,9000010.11,.01,1,2,"%D",1,0)
The IMMUNIZATION DOCUMENTER field (#1206) will be triggered whenever the
"^DD",9000010.11,9000010.11,.01,1,2,"%D",2,0)
IMMUNIZATION field (#.01) is entered or updated.  The triggered value 
"^DD",9000010.11,9000010.11,.01,1,2,"%D",3,0)
will be the DUZ of the user.
"^DD",9000010.11,9000010.11,.01,1,2,"CREATE VALUE")
S X=$G(DUZ)
"^DD",9000010.11,9000010.11,.01,1,2,"DELETE VALUE")
NO EFFECT
"^DD",9000010.11,9000010.11,.01,1,2,"DT")
3140422
"^DD",9000010.11,9000010.11,.01,1,2,"FIELD")
IMMUNIZATION DOCUMENTER
"^DD",9000010.11,9000010.11,.01,1,3,0)
9000010.11^AATOO^MUMPS
"^DD",9000010.11,9000010.11,.01,1,3,1)
I $P(^AUPNVIMM(DA,0),U,2)]"",$P(^(0),U,3)]"" S ^AUPNVIMM("AA",$P(^AUPNVIMM(DA,0),U,2),X,(9999999-$P(+^AUPNVSIT($P(^AUPNVIMM(DA,0),U,3),0),".",1)),DA)=""
"^DD",9000010.11,9000010.11,.01,1,3,2)
I $P(^AUPNVIMM(DA,0),U,2)]"",$P(^(0),U,3)]"" K ^AUPNVIMM("AA",$P(^AUPNVIMM(DA,0),U,2),X,(9999999-$P(+^AUPNVSIT($P(^AUPNVIMM(DA,0),U,3),0),".",1)),DA)
"^DD",9000010.11,9000010.11,.01,1,3,"%D",0)
^^5^5^2950901^^
"^DD",9000010.11,9000010.11,.01,1,3,"%D",1,0)
This cross reference is used for searches in sequence by patient,
"^DD",9000010.11,9000010.11,.01,1,3,"%D",2,0)
immunization internal entry, inverted visit date, and internal
"^DD",9000010.11,9000010.11,.01,1,3,"%D",3,0)
entry number.
"^DD",9000010.11,9000010.11,.01,1,3,"%D",4,0)
 
"^DD",9000010.11,9000010.11,.01,1,3,"%D",5,0)
   "AA",PATIENT,IMMUNIZATION,VISIT,DA
"^DD",9000010.11,9000010.11,.01,1,4,0)
9000010.11^AC^MUMPS
"^DD",9000010.11,9000010.11,.01,1,4,1)
D STOCK^PXVXR Q
"^DD",9000010.11,9000010.11,.01,1,4,2)
Q
"^DD",9000010.11,9000010.11,.01,1,4,"%D",0)
^^2^2^3150604^
"^DD",9000010.11,9000010.11,.01,1,4,"%D",1,0)
This MUMPS cross reference checks for the availability of the selected
"^DD",9000010.11,9000010.11,.01,1,4,"%D",2,0)
immunization in the immunization inventory.
"^DD",9000010.11,9000010.11,.01,1,4,"DT")
3150604
"^DD",9000010.11,9000010.11,.01,3)
Enter the name of the immunization given to the patient.
"^DD",9000010.11,9000010.11,.01,12)
Allow only active Immunization types to be selected.
"^DD",9000010.11,9000010.11,.01,12.1)
S DIC("S")="I $P(^(0),U,7)'=1"
"^DD",9000010.11,9000010.11,.01,21,0)
^.001^2^2^3150421^^^
"^DD",9000010.11,9000010.11,.01,21,1,0)
This is the type of immunization that was given to the patient at the
"^DD",9000010.11,9000010.11,.01,21,2,0)
encounter.
"^DD",9000010.11,9000010.11,.01,23,0)
^.001^2^2^3150421^^^
"^DD",9000010.11,9000010.11,.01,23,1,0)
Entries in the Immunization File (#9999999.14) may be made inactive.
"^DD",9000010.11,9000010.11,.01,23,2,0)
Inactive entries cannot be selected.
"^DD",9000010.11,9000010.11,.01,"AUDIT")
y
"^DD",9000010.11,9000010.11,.01,"DT")
3150604
"^DD",9000010.11,9000010.11,.02,0)
PATIENT NAME^RP9000001'Ia^AUPNPAT(^0;2^Q
"^DD",9000010.11,9000010.11,.02,1,0)
^.1
"^DD",9000010.11,9000010.11,.02,1,2,0)
9000010.11^AATOO2^MUMPS
"^DD",9000010.11,9000010.11,.02,1,2,1)
I $P(^AUPNVIMM(DA,0),U,3)]"" S ^AUPNVIMM("AA",X,+^AUPNVIMM(DA,0),(9999999-$P(+^AUPNVSIT($P(^AUPNVIMM(DA,0),U,3),0),".",1)),DA)=""
"^DD",9000010.11,9000010.11,.02,1,2,2)
I $P(^AUPNVIMM(DA,0),U,3)]"" K ^AUPNVIMM("AA",X,+^AUPNVIMM(DA,0),(9999999-$P(+^AUPNVSIT($P(^AUPNVIMM(DA,0),U,3),0),".",1)),DA)
"^DD",9000010.11,9000010.11,.02,1,2,"%D",0)
^^2^2^2940127^
"^DD",9000010.11,9000010.11,.02,1,2,"%D",1,0)
This is a Health Summary cross-reference.
"^DD",9000010.11,9000010.11,.02,1,2,"%D",2,0)
"AA",PATIENT,IMMUNIZATION,VISIT,DA
"^DD",9000010.11,9000010.11,.02,1,3,0)
9000010.11^C
"^DD",9000010.11,9000010.11,.02,1,3,1)
S ^AUPNVIMM("C",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.11,.02,1,3,2)
K ^AUPNVIMM("C",$E(X,1,30),DA)
"^DD",9000010.11,9000010.11,.02,1,3,"%D",0)
^^1^1^2950901^
"^DD",9000010.11,9000010.11,.02,1,3,"%D",1,0)
This cross reference provides a look-up of immunizations by patient name.
"^DD",9000010.11,9000010.11,.02,1,3,"DT")
2950901
"^DD",9000010.11,9000010.11,.02,3)
Enter the patient who was given the immunization.
"^DD",9000010.11,9000010.11,.02,21,0)
^.001^1^1^3140701^^^
"^DD",9000010.11,9000010.11,.02,21,1,0)
This is the patient who was given the immunization.
"^DD",9000010.11,9000010.11,.02,23,0)
^^3^3^3140701^
"^DD",9000010.11,9000010.11,.02,23,1,0)
This is a pointer the Patient/IHS file (#9000001), which is dinumed to 
"^DD",9000010.11,9000010.11,.02,23,2,0)
the PATIENT file (#2).  This field is always stuffed by the application. 
"^DD",9000010.11,9000010.11,.02,23,3,0)
No editing is allowed.
"^DD",9000010.11,9000010.11,.02,"AUDIT")
y
"^DD",9000010.11,9000010.11,.02,"DT")
3150213
"^DD",9000010.11,9000010.11,.03,0)
VISIT^R*P9000010'Ia^AUPNVSIT(^0;3^S DIC("S")="I $P(^(0),U,5)=$P(^AUPNVIMM(DA,0),U,2)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.11,9000010.11,.03,1,0)
^.1
"^DD",9000010.11,9000010.11,.03,1,1,0)
9000010.11^AD
"^DD",9000010.11,9000010.11,.03,1,1,1)
S ^AUPNVIMM("AD",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.11,.03,1,1,2)
K ^AUPNVIMM("AD",$E(X,1,30),DA)
"^DD",9000010.11,9000010.11,.03,1,1,"%D",0)
^^4^4^2950901^
"^DD",9000010.11,9000010.11,.03,1,1,"%D",1,0)
This cross reference is used for searches by the visit pointer and
"^DD",9000010.11,9000010.11,.03,1,1,"%D",2,0)
internal entry number.
"^DD",9000010.11,9000010.11,.03,1,1,"%D",3,0)
 
"^DD",9000010.11,9000010.11,.03,1,1,"%D",4,0)
  "AD",VISIT pointer, DA
"^DD",9000010.11,9000010.11,.03,1,2,0)
9000010.11^AA^MUMPS
"^DD",9000010.11,9000010.11,.03,1,2,1)
Q:$P(^AUPNVIMM(DA,0),U,2)=""  S ^AUPNVIMM("AA",$P(^AUPNVIMM(DA,0),U,2),+^AUPNVIMM(DA,0),(9999999-$P(+^AUPNVSIT(X,0),".",1)),DA)=""
"^DD",9000010.11,9000010.11,.03,1,2,2)
Q:$P(^AUPNVIMM(DA,0),U,2)=""  K ^AUPNVIMM("AA",$P(^AUPNVIMM(DA,0),U,2),+^AUPNVIMM(DA,0),(9999999-$P(+^AUPNVSIT(X,0),".",1)),DA)
"^DD",9000010.11,9000010.11,.03,1,2,"%D",0)
^.101^4^4^3140626^^
"^DD",9000010.11,9000010.11,.03,1,2,"%D",1,0)
This cross-reference is used for searches in sequence by patient,
"^DD",9000010.11,9000010.11,.03,1,2,"%D",2,0)
Immunization pointer, inverted visit date, and internal entry number.
"^DD",9000010.11,9000010.11,.03,1,2,"%D",3,0)
 
"^DD",9000010.11,9000010.11,.03,1,2,"%D",4,0)
    "AA",PATIENT,IMMUNIZATION,VISIT,DA
"^DD",9000010.11,9000010.11,.03,1,3,0)
9000010.11^AV10^MUMPS
"^DD",9000010.11,9000010.11,.03,1,3,1)
D ADD^AUPNVSIT
"^DD",9000010.11,9000010.11,.03,1,3,2)
D SUB^AUPNVSIT
"^DD",9000010.11,9000010.11,.03,1,3,"%D",0)
^^2^2^2940127^^
"^DD",9000010.11,9000010.11,.03,1,3,"%D",1,0)
This cross-reference adds and subtracts from the dependent entry count in
"^DD",9000010.11,9000010.11,.03,1,3,"%D",2,0)
the VISIT file.
"^DD",9000010.11,9000010.11,.03,3)
Enter the visit date/time for the encounter where the immunization was given.
"^DD",9000010.11,9000010.11,.03,12)
VISIT MUST BE FOR CURRENT PATIENT
"^DD",9000010.11,9000010.11,.03,12.1)
S DIC("S")="I $P(^(0),U,5)=$P(^AUPNVIMM(DA,0),U,2)"
"^DD",9000010.11,9000010.11,.03,21,0)
^.001^2^2^3140422^^
"^DD",9000010.11,9000010.11,.03,21,1,0)
This is the encounter defined in the Visit file that represents when and
"^DD",9000010.11,9000010.11,.03,21,2,0)
where the immunization was given.
"^DD",9000010.11,9000010.11,.03,23,0)
^.001^2^2^3140422^^
"^DD",9000010.11,9000010.11,.03,23,1,0)
This is a pointer to the Visit File (#9000010).  This field is stuffed by
"^DD",9000010.11,9000010.11,.03,23,2,0)
the applications. No editing is allowed.
"^DD",9000010.11,9000010.11,.03,"AUDIT")
y
"^DD",9000010.11,9000010.11,.03,"DT")
3150213
"^DD",9000010.11,9000010.11,.04,0)
SERIES^*Sa^P:PARTIALLY COMPLETE;C:COMPLETE;B:BOOSTER;1:SERIES 1;2:SERIES 2;3:SERIES 3;4:SERIES 4;5:SERIES 5;6:SERIES 6;7:SERIES 7;8:SERIES 8;^0;4^Q
"^DD",9000010.11,9000010.11,.04,.1)
Series
"^DD",9000010.11,9000010.11,.04,1,0)
^.1^^0
"^DD",9000010.11,9000010.11,.04,3)
Enter the series number, booster, partial or complete.
"^DD",9000010.11,9000010.11,.04,12)
Screen prevents selection of inappropriate series of immunization type.
"^DD",9000010.11,9000010.11,.04,12.1)
S DIC("S")="I Y'>$$SERIES^PXVUTL0"
"^DD",9000010.11,9000010.11,.04,21,0)
^.001^2^2^3150211^^^^
"^DD",9000010.11,9000010.11,.04,21,1,0)
This field allows the provider to specify which series of immunization
"^DD",9000010.11,9000010.11,.04,21,2,0)
type was given to the patient.
"^DD",9000010.11,9000010.11,.04,"AUDIT")
y
"^DD",9000010.11,9000010.11,.04,"DT")
3150211
"^DD",9000010.11,9000010.11,.05,0)
LOT^*P9999999.41'a^AUTTIML(^0;5^S DIC("S")="I $P(^(0),U,3)=0,$D(^AUTTIML(""C"",$P(^AUPNVIMM(DA,0),U,1),Y))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.11,9000010.11,.05,3)
Select the lot of the immunization being administered.
"^DD",9000010.11,9000010.11,.05,12)
LOT MUST BE AVAILABLE AND MUST BE A VALID LOT FOR THE IMMUNIZATION BEING ENTERED.
"^DD",9000010.11,9000010.11,.05,12.1)
S DIC("S")="I $P(^(0),U,3)=0,$D(^AUTTIML(""C"",$P(^AUPNVIMM(DA,0),U,1),Y))"
"^DD",9000010.11,9000010.11,.05,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,.05,21,1,0)
This Indian Health Service field indicates the lot number associated 
"^DD",9000010.11,9000010.11,.05,21,2,0)
with this immunization.
"^DD",9000010.11,9000010.11,.05,23,0)
^.001^5^5^3140625^^^
"^DD",9000010.11,9000010.11,.05,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.05,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.05,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.05,23,4,0)
 
"^DD",9000010.11,9000010.11,.05,23,5,0)
APCDALVR Variable = APCDALVR("APCDTLOT")
"^DD",9000010.11,9000010.11,.05,"AUDIT")
y
"^DD",9000010.11,9000010.11,.05,"DT")
3150213
"^DD",9000010.11,9000010.11,.06,0)
REACTION^Sa^1:FEVER;2:IRRITABILITY;3:LOCAL REACTION OR SWELLING;4:VOMITING;5:RASH OR ITCHING;6:LETHARGY;7:CONVULSIONS;8:ARTHRITIS OR ARTHRALGIAS;9:ANAPHYLAXIS OR COLLAPSE;10:RESPIRATORY DISTRESS;11:OTHER;0:NONE;^0;6^Q
"^DD",9000010.11,9000010.11,.06,3)
Enter the number representing the patients reaction to the immunization.
"^DD",9000010.11,9000010.11,.06,21,0)
^^2^2^2950901^
"^DD",9000010.11,9000010.11,.06,21,1,0)
This is the reaction that may have been observed by the provider as a
"^DD",9000010.11,9000010.11,.06,21,2,0)
result of the immunization given.
"^DD",9000010.11,9000010.11,.06,"AUDIT")
y
"^DD",9000010.11,9000010.11,.06,"DT")
3150213
"^DD",9000010.11,9000010.11,.07,0)
CONTRAINDICATED^Sa^1:YES (DO NOT REPEAT THIS VACCINE).;0:NO (OK TO USE IN THE FUTURE);^0;7^Q
"^DD",9000010.11,9000010.11,.07,3)
Enter 1 if this immunization should not be given to the patient in the future.
"^DD",9000010.11,9000010.11,.07,21,0)
^^3^3^2950901^
"^DD",9000010.11,9000010.11,.07,21,1,0)
This field allows the immunization to be recorded as contraindicated.
"^DD",9000010.11,9000010.11,.07,21,2,0)
Reminders will include a check to see if the previous immunization was 
"^DD",9000010.11,9000010.11,.07,21,3,0)
contraindicated before creating reminders.
"^DD",9000010.11,9000010.11,.07,"AUDIT")
y
"^DD",9000010.11,9000010.11,.07,"DT")
3150213
"^DD",9000010.11,9000010.11,.08,0)
DOSE OVERRIDE^Sa^0:@;1:INVALID--BAD STORAGE;2:INVALID--DEFECTIVE;3:INVALID--EXPIRED;4:INVALID--ADMIN ERROR;9:FORCED VALID;^0;8^Q
"^DD",9000010.11,9000010.11,.08,3)
Select the reason for this dose override.
"^DD",9000010.11,9000010.11,.08,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,.08,21,1,0)
This Indian Health Service field indicates the dose override status of 
"^DD",9000010.11,9000010.11,.08,21,2,0)
this immunization.
"^DD",9000010.11,9000010.11,.08,23,0)
^.001^3^3^3140625^^
"^DD",9000010.11,9000010.11,.08,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.08,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.08,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.08,"AUDIT")
y
"^DD",9000010.11,9000010.11,.08,"DT")
3150213
"^DD",9000010.11,9000010.11,.09,0)
INJECTION SITE^Sa^LTI:Left Thigh IM;LTS:Left Thigh SQ;RTI:Right Thigh IM;RTS:Right Thigh SQ;BTI:Both Thighs IM;LDI:Left Delt IM;LAS:Left Arm SQ;RDI:Right Delt IM;RAS:Right Arm SQ;O:Oral;IN:Nasal;LID:Left Arm Intradermal;RID:Right Arm Intradermal;^0;9^Q
"^DD",9000010.11,9000010.11,.09,3)
Enter the body site where the injection was given.
"^DD",9000010.11,9000010.11,.09,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,.09,21,1,0)
This Indian Health Service field identifies the body site where the 
"^DD",9000010.11,9000010.11,.09,21,2,0)
immunization was administered.
"^DD",9000010.11,9000010.11,.09,23,0)
^.001^3^3^3140626^^^
"^DD",9000010.11,9000010.11,.09,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.09,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.09,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.09,"AUDIT")
y
"^DD",9000010.11,9000010.11,.09,"DT")
3140625
"^DD",9000010.11,9000010.11,.11,0)
VOLUME^NJ4,2a^^0;11^K:+X'=X!(X>5)!(X<0)!(X?.E1"."3N.N) X
"^DD",9000010.11,9000010.11,.11,3)
Type a Number between 0 and 5, 2 Decimal Digits
"^DD",9000010.11,9000010.11,.11,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,.11,21,1,0)
This Indian Health Service field indicates the volume of vaccine 
"^DD",9000010.11,9000010.11,.11,21,2,0)
administered for this immunization.
"^DD",9000010.11,9000010.11,.11,23,0)
^.001^3^3^3140626^^^
"^DD",9000010.11,9000010.11,.11,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.11,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.11,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.11,"AUDIT")
y
"^DD",9000010.11,9000010.11,.11,"DT")
3150213
"^DD",9000010.11,9000010.11,.12,0)
DATE OF VAC INFO STATEMENT^Da^^0;12^S %DT="EX" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.11,9000010.11,.12,3)
Enter the date the vaccine information statement for this vaccine was offered to the patient.
"^DD",9000010.11,9000010.11,.12,21,0)
^^3^3^3140701^
"^DD",9000010.11,9000010.11,.12,21,1,0)
This Indian Health Service field indicates the date the vaccine 
"^DD",9000010.11,9000010.11,.12,21,2,0)
information statement associated with this immunization was 
"^DD",9000010.11,9000010.11,.12,21,3,0)
offered/given to the patient.
"^DD",9000010.11,9000010.11,.12,23,0)
^.001^3^3^3140625^^
"^DD",9000010.11,9000010.11,.12,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.12,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.12,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.12,"AUDIT")
y
"^DD",9000010.11,9000010.11,.12,"DT")
3150213
"^DD",9000010.11,9000010.11,.13,0)
CREATED BY V CPT ENTRY^NJ9,0a^^0;13^K:+X'=X!(X>999999999)!(X<0)!(X?.E1"."1N.N) X
"^DD",9000010.11,9000010.11,.13,3)
Enter the IEN of the V CPT entry that created this V Immunization.
"^DD",9000010.11,9000010.11,.13,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,.13,21,1,0)
This Indian Health Service field identifies the V CPT entry, if any,
"^DD",9000010.11,9000010.11,.13,21,2,0)
that created this V Immunization entry.
"^DD",9000010.11,9000010.11,.13,23,0)
^.001^3^3^3140625^^
"^DD",9000010.11,9000010.11,.13,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.13,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.13,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.13,"AUDIT")
y
"^DD",9000010.11,9000010.11,.13,"DT")
3150213
"^DD",9000010.11,9000010.11,.14,0)
VAC ELIGIBILITY^P9002084.83'a^BIELIG(^0;14^Q
"^DD",9000010.11,9000010.11,.14,3)
Enter the patient's VFC Eligibility on this visit.
"^DD",9000010.11,9000010.11,.14,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,.14,21,1,0)
This Indian Health Service field indicates the Vaccine for Children 
"^DD",9000010.11,9000010.11,.14,21,2,0)
(VFC) Program eligibility for this patient on this visit.
"^DD",9000010.11,9000010.11,.14,23,0)
^.001^6^6^3140829^^^
"^DD",9000010.11,9000010.11,.14,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.14,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.14,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.14,23,4,0)
 
"^DD",9000010.11,9000010.11,.14,23,5,0)
This field points to Indian Health Service's BI TABLE ELIGIBILITY CODES file
"^DD",9000010.11,9000010.11,.14,23,6,0)
(#9002084.83) which is not used by the Department of Veterans Affairs.
"^DD",9000010.11,9000010.11,.14,"AUDIT")
y
"^DD",9000010.11,9000010.11,.14,"DT")
3150213
"^DD",9000010.11,9000010.11,.15,0)
IMPORT FROM OUTSIDE REGISTRY^Sa^1:IMPORTED;0:NOT IMPORTED;2:EDITED AFTER IMPORT;^0;15^Q
"^DD",9000010.11,9000010.11,.15,3)
Enter 1 if this immunization was imported from an outside registry.
"^DD",9000010.11,9000010.11,.15,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,.15,21,1,0)
This Indian Health Service field indicated the import status of this 
"^DD",9000010.11,9000010.11,.15,21,2,0)
immunization from an outside registry.
"^DD",9000010.11,9000010.11,.15,23,0)
^.001^3^3^3140625^^
"^DD",9000010.11,9000010.11,.15,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.15,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.15,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.15,"AUDIT")
y
"^DD",9000010.11,9000010.11,.15,"DT")
3150213
"^DD",9000010.11,9000010.11,.16,0)
NDC^P9002084.95'a^BINDC(^0;16^Q
"^DD",9000010.11,9000010.11,.16,3)
Select the NDC Code for this immunization. Enter
"^DD",9000010.11,9000010.11,.16,21,0)
^.001^2^2^3140829^^^
"^DD",9000010.11,9000010.11,.16,21,1,0)
This Indian Health Service field identifies the National Drug Code 
"^DD",9000010.11,9000010.11,.16,21,2,0)
(NDC) for this vaccine.
"^DD",9000010.11,9000010.11,.16,23,0)
^.001^6^6^3140829^^^^
"^DD",9000010.11,9000010.11,.16,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,.16,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,.16,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,.16,23,4,0)
 
"^DD",9000010.11,9000010.11,.16,23,5,0)
This field points to Indian Health Service's BI TABLE NDC CODES file
"^DD",9000010.11,9000010.11,.16,23,6,0)
(#9002084.95) which is not used by the Department of Veterans Affairs.
"^DD",9000010.11,9000010.11,.16,"AUDIT")
y
"^DD",9000010.11,9000010.11,.16,"DT")
3150213
"^DD",9000010.11,9000010.11,1,0)
ADMINISTRATIVE NOTES^Fa^^1;1^K:$L(X)>160!($L(X)<1) X
"^DD",9000010.11,9000010.11,1,3)
Answer must be 1-160 characters in length
"^DD",9000010.11,9000010.11,1,21,0)
^^2^2^3140701^
"^DD",9000010.11,9000010.11,1,21,1,0)
This Indian Health Service field is a free text field used to document
"^DD",9000010.11,9000010.11,1,21,2,0)
administrative information about this immunization.
"^DD",9000010.11,9000010.11,1,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.11,1,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1,"AUDIT")
y
"^DD",9000010.11,9000010.11,1,"DT")
3150213
"^DD",9000010.11,9000010.11,2,0)
VIS OFFERED/GIVEN TO PATIENT^9000010.112PA^^2;0
"^DD",9000010.11,9000010.11,2,21,0)
^.001^3^3^3150518^^
"^DD",9000010.11,9000010.11,2,21,1,0)
This is the Vaccine Information Statement (VIS) that was offered to the 
"^DD",9000010.11,9000010.11,2,21,2,0)
patient prior to the administration of the immunization, along with the
"^DD",9000010.11,9000010.11,2,21,3,0)
date/time it was offered.
"^DD",9000010.11,9000010.11,3,0)
OTHER DIAGNOSIS^9000010.113P^^3;0
"^DD",9000010.11,9000010.11,3,21,0)
^.001^2^2^3140626^^
"^DD",9000010.11,9000010.11,3,21,1,0)
This is a list of diagnoses for this immunization event, in addition to
"^DD",9000010.11,9000010.11,3,21,2,0)
the Primary Diagnosis selected for this event.
"^DD",9000010.11,9000010.11,3,23,0)
^.001^3^3^3140626^^
"^DD",9000010.11,9000010.11,3,23,1,0)
This is a multiple of diagnoses for this immunization event.  They are in
"^DD",9000010.11,9000010.11,3,23,2,0)
addition to the PRIMARY DIAGNOSIS.  They are selected from the ICD
"^DD",9000010.11,9000010.11,3,23,3,0)
DIAGNOSIS file (#80).
"^DD",9000010.11,9000010.11,1101,0)
REMARKS^9000010.1111^^11;0
"^DD",9000010.11,9000010.11,1101,21,0)
^^2^2^2950901^
"^DD",9000010.11,9000010.11,1101,21,1,0)
This is additional comments or remarks related to the immunization given
"^DD",9000010.11,9000010.11,1101,21,2,0)
to the patient.
"^DD",9000010.11,9000010.11,1201,0)
EVENT DATE AND TIME^DXa^^12;1^S %DT="ET" D ^%DT S X=Y K:Y<1!$$TIME^PXVUTL X
"^DD",9000010.11,9000010.11,1201,1,0)
^.1^^-1
"^DD",9000010.11,9000010.11,1201,1,1,0)
^^TRIGGER^9000010.11^1205
"^DD",9000010.11,9000010.11,1201,1,1,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVIMM(D0,12)):^(12),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X=DIV N %I,%H,% D NOW^%DTC S X=% X ^DD(9000010.11,1201,1,1,1.4)
"^DD",9000010.11,9000010.11,1201,1,1,1.4)
S DIH=$G(^AUPNVIMM(DIV(0),12)),DIV=X S $P(^(12),U,5)=DIV,DIH=9000010.11,DIG=1205 D ^DICR
"^DD",9000010.11,9000010.11,1201,1,1,2)
Q
"^DD",9000010.11,9000010.11,1201,1,1,"%D",0)
^^3^3^3140422^
"^DD",9000010.11,9000010.11,1201,1,1,"%D",1,0)
The DATE/TIME RECORDED field (#1205) will be triggered whenever the 
"^DD",9000010.11,9000010.11,1201,1,1,"%D",2,0)
EVENT DATE AND TIME field (#1201) is entered or updated.  The triggered
"^DD",9000010.11,9000010.11,1201,1,1,"%D",3,0)
value will be NOW.
"^DD",9000010.11,9000010.11,1201,1,1,"CREATE VALUE")
NOW
"^DD",9000010.11,9000010.11,1201,1,1,"DELETE VALUE")
NO EFFECT
"^DD",9000010.11,9000010.11,1201,1,1,"FIELD")
DATE/TIME RECORDED
"^DD",9000010.11,9000010.11,1201,3)
Enter the date and (optional) time the immunization was given.
"^DD",9000010.11,9000010.11,1201,21,0)
^^10^10^3150820^
"^DD",9000010.11,9000010.11,1201,21,1,0)
This is the date and time the immunization was given. This date and time
"^DD",9000010.11,9000010.11,1201,21,2,0)
may be different from the visit date and time. For example, for clinic
"^DD",9000010.11,9000010.11,1201,21,3,0)
appointment visits, the visit date and time is the date and time of the
"^DD",9000010.11,9000010.11,1201,21,4,0)
appointment, not the time the provider performed the clinical event.
"^DD",9000010.11,9000010.11,1201,21,5,0)
 
"^DD",9000010.11,9000010.11,1201,21,6,0)
The date may be an imprecise date such as for an historical 
"^DD",9000010.11,9000010.11,1201,21,7,0)
immunization.
"^DD",9000010.11,9000010.11,1201,21,8,0)
 
"^DD",9000010.11,9000010.11,1201,21,9,0)
Date and time may be within 30 days before or after the visit date, 
"^DD",9000010.11,9000010.11,1201,21,10,0)
with the restriction the date cannot be a future date.
"^DD",9000010.11,9000010.11,1201,23,0)
^^13^13^3150820^^
"^DD",9000010.11,9000010.11,1201,23,1,0)
The PCE User Interface, which allows manual entry of data, will be the primary
"^DD",9000010.11,9000010.11,1201,23,2,0)
source of the immunization date and time.  The immunization date prompt defaults
"^DD",9000010.11,9000010.11,1201,23,3,0)
to the visit date and the time is entered to reflect the actual time the
"^DD",9000010.11,9000010.11,1201,23,4,0)
immunization was given.  The immunization date does not have to be the visit
"^DD",9000010.11,9000010.11,1201,23,5,0)
date, but it must be within 30 days before or after the visit, and not be a
"^DD",9000010.11,9000010.11,1201,23,6,0)
future date.
"^DD",9000010.11,9000010.11,1201,23,7,0)
 
"^DD",9000010.11,9000010.11,1201,23,8,0)
If the user wants to enter an historical immunization, the user should use the
"^DD",9000010.11,9000010.11,1201,23,9,0)
Historical Encounter entry action to document the historical immunization. 
"^DD",9000010.11,9000010.11,1201,23,10,0)
Historical entries will not be eligible for credit.
"^DD",9000010.11,9000010.11,1201,23,11,0)
 
"^DD",9000010.11,9000010.11,1201,23,12,0)
PCE data sources for automatic (scanning) data capture will be blank unless the
"^DD",9000010.11,9000010.11,1201,23,13,0)
immunization date and time are passed to PCE for filing.
"^DD",9000010.11,9000010.11,1201,"AUDIT")
y
"^DD",9000010.11,9000010.11,1201,"DT")
3150820
"^DD",9000010.11,9000010.11,1202,0)
ORDERING PROVIDER^P200'a^VA(200,^12;2^Q
"^DD",9000010.11,9000010.11,1202,3)
Enter the provider who ordered this immunization.
"^DD",9000010.11,9000010.11,1202,21,0)
^^2^2^2960513^
"^DD",9000010.11,9000010.11,1202,21,1,0)
The field can be used to document the provider who ordered the
"^DD",9000010.11,9000010.11,1202,21,2,0)
immunization.
"^DD",9000010.11,9000010.11,1202,"AUDIT")
y
"^DD",9000010.11,9000010.11,1202,"DT")
3150213
"^DD",9000010.11,9000010.11,1203,0)
CLINIC^P40.7'a^DIC(40.7,^12;3^Q
"^DD",9000010.11,9000010.11,1203,3)
Select a clinic stop for this Immunization event.
"^DD",9000010.11,9000010.11,1203,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1203,21,1,0)
This Indian Health Service field indicates the clinic stop associated 
"^DD",9000010.11,9000010.11,1203,21,2,0)
with this visit.
"^DD",9000010.11,9000010.11,1203,23,0)
^.001^5^5^3140702^^^
"^DD",9000010.11,9000010.11,1203,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1203,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1203,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1203,23,4,0)
 
"^DD",9000010.11,9000010.11,1203,23,5,0)
APCDALVR Variable = APCDALVR("APCDTCLN")
"^DD",9000010.11,9000010.11,1203,"AUDIT")
y
"^DD",9000010.11,9000010.11,1203,"DT")
3150213
"^DD",9000010.11,9000010.11,1204,0)
ENCOUNTER PROVIDER^P200'a^VA(200,^12;4^Q
"^DD",9000010.11,9000010.11,1204,3)
Enter the provider who gave this immunization.
"^DD",9000010.11,9000010.11,1204,21,0)
^.001^2^2^3140829^^^^
"^DD",9000010.11,9000010.11,1204,21,1,0)
This is the provider who gave this
"^DD",9000010.11,9000010.11,1204,21,2,0)
immunization.
"^DD",9000010.11,9000010.11,1204,23,0)
^.001^1^1^3140829^^^
"^DD",9000010.11,9000010.11,1204,23,1,0)
This person can be any person in the new person file.
"^DD",9000010.11,9000010.11,1204,"AUDIT")
y
"^DD",9000010.11,9000010.11,1204,"DT")
3150213
"^DD",9000010.11,9000010.11,1205,0)
DATE/TIME RECORDED^Da^^12;5^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.11,9000010.11,1205,.1)
Date/Time Recorded
"^DD",9000010.11,9000010.11,1205,3)
Enter the date and time of documentation of the administration of the immunization.
"^DD",9000010.11,9000010.11,1205,5,1,0)
9000010.11^1201^1
"^DD",9000010.11,9000010.11,1205,9)
^
"^DD",9000010.11,9000010.11,1205,21,0)
^.001^3^3^3140416^^
"^DD",9000010.11,9000010.11,1205,21,1,0)
This timestamp field is the date and time of documentation of
"^DD",9000010.11,9000010.11,1205,21,2,0)
administration of the immunization. This field is set automatically 
"^DD",9000010.11,9000010.11,1205,21,3,0)
when the EVENT DATE AND TIME is entered.
"^DD",9000010.11,9000010.11,1205,"AUDIT")
y
"^DD",9000010.11,9000010.11,1205,"DT")
3150213
"^DD",9000010.11,9000010.11,1206,0)
IMMUNIZATION DOCUMENTER^P200'a^VA(200,^12;6^Q
"^DD",9000010.11,9000010.11,1206,.1)
Immunization Documenter
"^DD",9000010.11,9000010.11,1206,3)
Enter the person who documented this immunization in the system.
"^DD",9000010.11,9000010.11,1206,5,1,0)
9000010.11^.01^2
"^DD",9000010.11,9000010.11,1206,21,0)
^^2^2^3140422^
"^DD",9000010.11,9000010.11,1206,21,1,0)
This is the person/provider who documented this immunization by entering
"^DD",9000010.11,9000010.11,1206,21,2,0)
the data into the system by whatever means.
"^DD",9000010.11,9000010.11,1206,"AUDIT")
y
"^DD",9000010.11,9000010.11,1206,"DT")
3150213
"^DD",9000010.11,9000010.11,1207,0)
LOT NUMBER^*P9999999.41'a^AUTTIML(^12;7^S DIC("S")="I '$P(^(0),U,3),$P(^(0),U,9)'<DT,$$ACT^PXVXR" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
"^DD",9000010.11,9000010.11,1207,.1)
Lot Number
"^DD",9000010.11,9000010.11,1207,1,0)
^.1
"^DD",9000010.11,9000010.11,1207,1,1,0)
9000010.11^LN
"^DD",9000010.11,9000010.11,1207,1,1,1)
S ^AUPNVIMM("LN",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.11,1207,1,1,2)
K ^AUPNVIMM("LN",$E(X,1,30),DA)
"^DD",9000010.11,9000010.11,1207,1,1,3)
Used for look-up and to determine if a Lot Number entry is being used.
"^DD",9000010.11,9000010.11,1207,1,1,"%D",0)
^^3^3^3150603^
"^DD",9000010.11,9000010.11,1207,1,1,"%D",1,0)
This cross reference is used to determine if an entry in the 
"^DD",9000010.11,9000010.11,1207,1,1,"%D",2,0)
IMMUNIZATION LOT file is being used by an entry in the V IMMUNIZATION
"^DD",9000010.11,9000010.11,1207,1,1,"%D",3,0)
file. Can also be used for V IMMUNIZATION look-ups.
"^DD",9000010.11,9000010.11,1207,1,1,"DT")
3140609
"^DD",9000010.11,9000010.11,1207,1,2,0)
9000010.11^AF^MUMPS
"^DD",9000010.11,9000010.11,1207,1,2,1)
D DECR^PXVXR Q
"^DD",9000010.11,9000010.11,1207,1,2,2)
D INCR^PXVXR Q
"^DD",9000010.11,9000010.11,1207,1,2,"%D",0)
^^2^2^3150616^
"^DD",9000010.11,9000010.11,1207,1,2,"%D",1,0)
This MUMPS type cross reference maintains the number of doses remaining 
"^DD",9000010.11,9000010.11,1207,1,2,"%D",2,0)
unused of this lot number.
"^DD",9000010.11,9000010.11,1207,1,2,"DT")
3150616
"^DD",9000010.11,9000010.11,1207,3)
Enter the lot number for this immunization.
"^DD",9000010.11,9000010.11,1207,12)
Screen requires selection of active lot for selected immunization.
"^DD",9000010.11,9000010.11,1207,12.1)
S DIC("S")="I '$P(^(0),U,3),$P(^(0),U,9)'<DT,$$ACT^PXVXR"
"^DD",9000010.11,9000010.11,1207,21,0)
^^2^2^3150824^
"^DD",9000010.11,9000010.11,1207,21,1,0)
This is the lot number of the immunization entered for this event. If
"^DD",9000010.11,9000010.11,1207,21,2,0)
historical event, enter lot number (if known) in Comments.
"^DD",9000010.11,9000010.11,1207,"AUDIT")
y
"^DD",9000010.11,9000010.11,1207,"DT")
3150824
"^DD",9000010.11,9000010.11,1208,0)
PARENT^P9000010.11'a^AUPNVIMM(^12;8^Q
"^DD",9000010.11,9000010.11,1208,3)
Select the parent event to this one.
"^DD",9000010.11,9000010.11,1208,21,0)
^^3^3^3140702^
"^DD",9000010.11,9000010.11,1208,21,1,0)
This Indian Health Service field indicates the parent immunization, if 
"^DD",9000010.11,9000010.11,1208,21,2,0)
any, associated with this immunization, such as for immunizations given 
"^DD",9000010.11,9000010.11,1208,21,3,0)
in series.
"^DD",9000010.11,9000010.11,1208,23,0)
^.001^5^5^3140626^^^
"^DD",9000010.11,9000010.11,1208,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1208,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1208,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1208,23,4,0)
 
"^DD",9000010.11,9000010.11,1208,23,5,0)
APCDALVR Variable = APCDALVR("APCDTPNT")
"^DD",9000010.11,9000010.11,1208,"AUDIT")
y
"^DD",9000010.11,9000010.11,1208,"DT")
3150213
"^DD",9000010.11,9000010.11,1209,0)
EXTERNAL KEY^Fa^^12;9^K:$L(X)>20!($L(X)<1) X
"^DD",9000010.11,9000010.11,1209,3)
Answer must be 1-20 characters in length.
"^DD",9000010.11,9000010.11,1209,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1209,21,1,0)
This Indian Health Service free text field identifies the external key 
"^DD",9000010.11,9000010.11,1209,21,2,0)
associated with this immunization.
"^DD",9000010.11,9000010.11,1209,23,0)
^.001^5^5^3140625^^
"^DD",9000010.11,9000010.11,1209,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1209,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1209,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1209,23,4,0)
 
"^DD",9000010.11,9000010.11,1209,23,5,0)
APCDALVR Variable = APCDALVR("APCDTEXK")
"^DD",9000010.11,9000010.11,1209,"AUDIT")
y
"^DD",9000010.11,9000010.11,1209,"DT")
3150213
"^DD",9000010.11,9000010.11,1210,0)
OUTSIDE PROVIDER NAME^Fa^^12;10^K:$L(X)>30!($L(X)<1) X
"^DD",9000010.11,9000010.11,1210,3)
Answer must be 1-30 characters in length.
"^DD",9000010.11,9000010.11,1210,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1210,21,1,0)
This Indian Health Service field contains the name of the outside 
"^DD",9000010.11,9000010.11,1210,21,2,0)
provider associated with this immunization.
"^DD",9000010.11,9000010.11,1210,23,0)
^.001^5^5^3140626^^^
"^DD",9000010.11,9000010.11,1210,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1210,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1210,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1210,23,4,0)
  
"^DD",9000010.11,9000010.11,1210,23,5,0)
APCDALVR Variable = APCDALVR("APCDTOPR")
"^DD",9000010.11,9000010.11,1210,"AUDIT")
y
"^DD",9000010.11,9000010.11,1210,"DT")
3150213
"^DD",9000010.11,9000010.11,1213,0)
ANCILLARY POV^P80'a^ICD9(^12;13^Q
"^DD",9000010.11,9000010.11,1213,3)
Select an ancillary diagnosis for this event.
"^DD",9000010.11,9000010.11,1213,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1213,21,1,0)
This Indian Health Service field indicated the ancillary diagnosis 
"^DD",9000010.11,9000010.11,1213,21,2,0)
related to this immunization.
"^DD",9000010.11,9000010.11,1213,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.11,1213,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1213,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1213,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1213,"AUDIT")
y
"^DD",9000010.11,9000010.11,1213,"DT")
3150213
"^DD",9000010.11,9000010.11,1214,0)
USER LAST UPDATE^P200'a^VA(200,^12;14^Q
"^DD",9000010.11,9000010.11,1214,3)
Enter the user who last updated this immunization event.
"^DD",9000010.11,9000010.11,1214,21,0)
^.001^2^2^3140819^^
"^DD",9000010.11,9000010.11,1214,21,1,0)
This Indian Health Service field indicates the user who last updated 
"^DD",9000010.11,9000010.11,1214,21,2,0)
information for this immunization.
"^DD",9000010.11,9000010.11,1214,23,0)
^.001^3^3^3140819^^
"^DD",9000010.11,9000010.11,1214,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1214,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1214,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1214,"AUDIT")
y
"^DD",9000010.11,9000010.11,1214,"DT")
3150213
"^DD",9000010.11,9000010.11,1215,0)
ORDERING LOCATION^P44'a^SC(^12;15^Q
"^DD",9000010.11,9000010.11,1215,3)
Select the location within this medical center where this Immunization was ordered.
"^DD",9000010.11,9000010.11,1215,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1215,21,1,0)
This Indian Health Service field indicated the hospital location ordering 
"^DD",9000010.11,9000010.11,1215,21,2,0)
this immunization.
"^DD",9000010.11,9000010.11,1215,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.11,1215,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1215,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1215,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1215,"AUDIT")
y
"^DD",9000010.11,9000010.11,1215,"DT")
3150213
"^DD",9000010.11,9000010.11,1216,0)
DATE/TIME ENTERED^Da^^12;16^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.11,9000010.11,1216,1,0)
^.1
"^DD",9000010.11,9000010.11,1216,1,1,0)
^^TRIGGER^9000010.11^1217
"^DD",9000010.11,9000010.11,1216,1,1,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVIMM(D0,12)):^(12),1:"") S X=$P(Y(1),U,17),X=X S DIU=X K Y S X=DIV I '$G(APCDVMUX) S X=DUZ X ^DD(9000010.11,1216,1,1,1.4)
"^DD",9000010.11,9000010.11,1216,1,1,1.4)
S DIH=$G(^AUPNVIMM(DIV(0),12)),DIV=X S $P(^(12),U,17)=DIV,DIH=9000010.11,DIG=1217 D ^DICR
"^DD",9000010.11,9000010.11,1216,1,1,2)
Q
"^DD",9000010.11,9000010.11,1216,1,1,"CREATE VALUE")
I '$G(APCDVMUX) S X=DUZ
"^DD",9000010.11,9000010.11,1216,1,1,"DELETE VALUE")
NO EFFECT
"^DD",9000010.11,9000010.11,1216,1,1,"DT")
3120423
"^DD",9000010.11,9000010.11,1216,1,1,"FIELD")
#1217
"^DD",9000010.11,9000010.11,1216,1,2,0)
^^TRIGGER^9000010.11^1218
"^DD",9000010.11,9000010.11,1216,1,2,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVIMM(D0,12)):^(12),1:"") S X=$P(Y(1),U,18),X=X S DIU=X K Y S X=DIV I '$G(APCDVMUX) S X=$$NOW^XLFDT X ^DD(9000010.11,1216,1,2,1.4)
"^DD",9000010.11,9000010.11,1216,1,2,1.4)
S DIH=$G(^AUPNVIMM(DIV(0),12)),DIV=X S $P(^(12),U,18)=DIV,DIH=9000010.11,DIG=1218 D ^DICR
"^DD",9000010.11,9000010.11,1216,1,2,2)
Q
"^DD",9000010.11,9000010.11,1216,1,2,"CREATE VALUE")
I '$G(APCDVMUX) S X=$$NOW^XLFDT
"^DD",9000010.11,9000010.11,1216,1,2,"DELETE VALUE")
NO EFFECT
"^DD",9000010.11,9000010.11,1216,1,2,"DT")
3120423
"^DD",9000010.11,9000010.11,1216,1,2,"FIELD")
#1218
"^DD",9000010.11,9000010.11,1216,3)
Enter the date and time this event was entered here.
"^DD",9000010.11,9000010.11,1216,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1216,21,1,0)
This Indian Health Service field indicates the date and time that this 
"^DD",9000010.11,9000010.11,1216,21,2,0)
immunization information was entered into this record.
"^DD",9000010.11,9000010.11,1216,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.11,1216,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1216,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1216,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1216,"AUDIT")
y
"^DD",9000010.11,9000010.11,1216,"DT")
3150213
"^DD",9000010.11,9000010.11,1217,0)
ENTERED BY^P200'a^VA(200,^12;17^Q
"^DD",9000010.11,9000010.11,1217,3)
Select the user who first entered this event.
"^DD",9000010.11,9000010.11,1217,5,1,0)
9000010.11^1216^1
"^DD",9000010.11,9000010.11,1217,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1217,21,1,0)
This Indian Health Service field indicates the user who entered this 
"^DD",9000010.11,9000010.11,1217,21,2,0)
immunization record.
"^DD",9000010.11,9000010.11,1217,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.11,1217,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1217,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1217,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1217,"AUDIT")
y
"^DD",9000010.11,9000010.11,1217,"DT")
3150213
"^DD",9000010.11,9000010.11,1218,0)
DATE/TIME LAST MODIFIED^Da^^12;18^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.11,9000010.11,1218,1,0)
^.1
"^DD",9000010.11,9000010.11,1218,1,1,0)
^^TRIGGER^9000010.11^1219
"^DD",9000010.11,9000010.11,1218,1,1,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVIMM(D0,12)):^(12),1:"") S X=$P(Y(1),U,19),X=X S DIU=X K Y S X=DIV I '$G(APCDVMUX) S X=DUZ X ^DD(9000010.11,1218,1,1,1.4)
"^DD",9000010.11,9000010.11,1218,1,1,1.4)
S DIH=$G(^AUPNVIMM(DIV(0),12)),DIV=X S $P(^(12),U,19)=DIV,DIH=9000010.11,DIG=1219 D ^DICR
"^DD",9000010.11,9000010.11,1218,1,1,2)
Q
"^DD",9000010.11,9000010.11,1218,1,1,"CREATE VALUE")
I '$G(APCDVMUX) S X=DUZ
"^DD",9000010.11,9000010.11,1218,1,1,"DELETE VALUE")
NO EFFECT
"^DD",9000010.11,9000010.11,1218,1,1,"DT")
3120423
"^DD",9000010.11,9000010.11,1218,1,1,"FIELD")
#1219
"^DD",9000010.11,9000010.11,1218,3)
Enter the date and time this event was last modified.
"^DD",9000010.11,9000010.11,1218,5,1,0)
9000010.11^1216^2
"^DD",9000010.11,9000010.11,1218,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1218,21,1,0)
This Indian Health Service field indicates the date and time this 
"^DD",9000010.11,9000010.11,1218,21,2,0)
immunization record was last modified.
"^DD",9000010.11,9000010.11,1218,23,0)
^.001^3^3^3140626^^^
"^DD",9000010.11,9000010.11,1218,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1218,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1218,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1218,"AUDIT")
y
"^DD",9000010.11,9000010.11,1218,"DT")
3150213
"^DD",9000010.11,9000010.11,1219,0)
LAST MODIFIED BY^P200'a^VA(200,^12;19^Q
"^DD",9000010.11,9000010.11,1219,3)
Select the user who last modified this event.
"^DD",9000010.11,9000010.11,1219,5,1,0)
9000010.11^1218^1
"^DD",9000010.11,9000010.11,1219,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.11,1219,21,1,0)
This Indian Health Service field indicates the user who last modified 
"^DD",9000010.11,9000010.11,1219,21,2,0)
this immunization record.
"^DD",9000010.11,9000010.11,1219,23,0)
^.001^3^3^3140625^^
"^DD",9000010.11,9000010.11,1219,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,1219,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,1219,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,1219,"AUDIT")
y
"^DD",9000010.11,9000010.11,1219,"DT")
3150213
"^DD",9000010.11,9000010.11,1301,0)
EVENT INFORMATION SOURCE^R*P920.1'a^PXV(920.1,^13;1^S DIC("S")="I '$P(^(0),U,3)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.11,9000010.11,1301,.1)
Information Source
"^DD",9000010.11,9000010.11,1301,3)
Select the source of this event's information.
"^DD",9000010.11,9000010.11,1301,12)
SOURCE selected must have a STATUS of ACTIVE
"^DD",9000010.11,9000010.11,1301,12.1)
S DIC("S")="I '$P(^(0),U,3)"
"^DD",9000010.11,9000010.11,1301,21,0)
^.001^2^2^3140626^^^^
"^DD",9000010.11,9000010.11,1301,21,1,0)
This is the source of the information obtained for this immunization
"^DD",9000010.11,9000010.11,1301,21,2,0)
event.  If this is a new event for this patient, no entry is required.
"^DD",9000010.11,9000010.11,1301,23,0)
^.001^3^3^3140626^^^
"^DD",9000010.11,9000010.11,1301,23,1,0)
This field is used to note the source of this immunization event.  If the
"^DD",9000010.11,9000010.11,1301,23,2,0)
event is a new record, no entry is necessary.  The options available for 
"^DD",9000010.11,9000010.11,1301,23,3,0)
this field come from the IMMUNIZATION INFO SOURCE file.
"^DD",9000010.11,9000010.11,1301,"AUDIT")
y
"^DD",9000010.11,9000010.11,1301,"DT")
3150213
"^DD",9000010.11,9000010.11,1302,0)
ROUTE OF ADMINISTRATION^*P920.2'a^PXV(920.2,^13;2^S DIC("S")="I '$$SCREEN^XTID(920.2,,Y_"","")" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.11,9000010.11,1302,.1)
Route of Administration
"^DD",9000010.11,9000010.11,1302,3)
Select the route of administration for this event.
"^DD",9000010.11,9000010.11,1302,12)
Only active IMM ADMINISTRATION ROUTE entries may be selected.
"^DD",9000010.11,9000010.11,1302,12.1)
S DIC("S")="I '$$SCREEN^XTID(920.2,,Y_"","")"
"^DD",9000010.11,9000010.11,1302,21,0)
^.001^2^2^3150813^^^^
"^DD",9000010.11,9000010.11,1302,21,1,0)
This is the method this vaccine was administered.  Select from the list
"^DD",9000010.11,9000010.11,1302,21,2,0)
provided.
"^DD",9000010.11,9000010.11,1302,23,0)
^.001^3^3^3150813^^^
"^DD",9000010.11,9000010.11,1302,23,1,0)
This is the method by which the vaccine was administered. This is
"^DD",9000010.11,9000010.11,1302,23,2,0)
selected from a set of values in the IMM ROUTE OF ADMINISTRATION
"^DD",9000010.11,9000010.11,1302,23,3,0)
file (#920.2).
"^DD",9000010.11,9000010.11,1302,"AUDIT")
y
"^DD",9000010.11,9000010.11,1302,"DT")
3150813
"^DD",9000010.11,9000010.11,1303,0)
SITE OF ADMINISTRATION (BODY)^*P920.3'a^PXV(920.3,^13;3^S DIC("S")="I '$$SCREEN^XTID(920.3,,Y_"","")" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
"^DD",9000010.11,9000010.11,1303,.1)
Site of Administration (Body)
"^DD",9000010.11,9000010.11,1303,3)
Select the site the vaccine was administered.
"^DD",9000010.11,9000010.11,1303,12)
Only active IMM ADMINISTRATION SITE (BODY) entries may be selected.
"^DD",9000010.11,9000010.11,1303,12.1)
S DIC("S")="I '$$SCREEN^XTID(920.3,,Y_"","")"
"^DD",9000010.11,9000010.11,1303,21,0)
^.001^2^2^3140625^^^
"^DD",9000010.11,9000010.11,1303,21,1,0)
This is the area of the patient's body through which the vaccine was
"^DD",9000010.11,9000010.11,1303,21,2,0)
administered.
"^DD",9000010.11,9000010.11,1303,23,0)
^^3^3^3140701^
"^DD",9000010.11,9000010.11,1303,23,1,0)
This is the area of the patient's body through which the vaccine was 
"^DD",9000010.11,9000010.11,1303,23,2,0)
administered.  It is selected from a list provided by the IMM 
"^DD",9000010.11,9000010.11,1303,23,3,0)
ADMINISTRATION SITE (BODY) file (#920.3).
"^DD",9000010.11,9000010.11,1303,"AUDIT")
y
"^DD",9000010.11,9000010.11,1303,"DT")
3150226
"^DD",9000010.11,9000010.11,1304,0)
PRIMARY DIAGNOSIS^*P80'Xa^ICD9(^13;4^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X I $D(X),$D(D0),$$DUPDX^PXVUTIL(D0,X) K X
"^DD",9000010.11,9000010.11,1304,.1)
Primary Diagnosis
"^DD",9000010.11,9000010.11,1304,3)
Select the primary (or initial) diagnosis for this immunization.
"^DD",9000010.11,9000010.11,1304,12)
Diagnosis must be appropriate and active.
"^DD",9000010.11,9000010.11,1304,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.11,9000010.11,1304,21,0)
^.001^2^2^3140620^^^
"^DD",9000010.11,9000010.11,1304,21,1,0)
This is the primary (or initial) diagnosis for this immunization event. It
"^DD",9000010.11,9000010.11,1304,21,2,0)
is selected from the ISC DIAGNOSIS file.
"^DD",9000010.11,9000010.11,1304,23,0)
^.001^4^4^3140620^^
"^DD",9000010.11,9000010.11,1304,23,1,0)
This is the primary diagnosis for this immunization.  This field is a
"^DD",9000010.11,9000010.11,1304,23,2,0)
pointer to the ICD DIAGNOSIS file (#80).  Selection is screened to make sure
"^DD",9000010.11,9000010.11,1304,23,3,0)
it's appropriate and active.  An immunization event can have more than
"^DD",9000010.11,9000010.11,1304,23,4,0)
one diagnosis - see the OTHER DIAGNOSIS field (#2).
"^DD",9000010.11,9000010.11,1304,"AUDIT")
y
"^DD",9000010.11,9000010.11,1304,"DT")
3150605
"^DD",9000010.11,9000010.11,1312,0)
DOSE^NJ6,2aO^^13;12^K:+X'=X!(X>999)!(X<0)!(X?.E1"."3N.N) X
"^DD",9000010.11,9000010.11,1312,2)
S Y(0)=Y S:Y Y=$FN(Y,",")
"^DD",9000010.11,9000010.11,1312,2.1)
S:Y Y=$FN(Y,",")
"^DD",9000010.11,9000010.11,1312,3)
Type a number between 0 and 999, 2 fractional digits.
"^DD",9000010.11,9000010.11,1312,21,0)
^^2^2^3150819^
"^DD",9000010.11,9000010.11,1312,21,1,0)
This is the amount of vaccine product administered for this immunization.
"^DD",9000010.11,9000010.11,1312,21,2,0)
The units are expressed in the DOSE UNITS field (#1313).
"^DD",9000010.11,9000010.11,1312,"AUDIT")
y
"^DD",9000010.11,9000010.11,1312,"DT")
3150819
"^DD",9000010.11,9000010.11,1312.5,0)
DOSAGE^CJ10^^ ; ^S X=$$DOSAGE^PXVUTIL(D0)
"^DD",9000010.11,9000010.11,1312.5,9.01)

"^DD",9000010.11,9000010.11,1312.5,9.1)
S X=$$DOSAGE^PXVUTIL(D0)
"^DD",9000010.11,9000010.11,1312.5,21,0)
^^2^2^3150819^
"^DD",9000010.11,9000010.11,1312.5,21,1,0)
A computed field that concatenates the DOSE (#1312) and DOSE UNITS (#1313)
"^DD",9000010.11,9000010.11,1312.5,21,2,0)
fields. The resulting output will look something likes this: ".5 mL".
"^DD",9000010.11,9000010.11,1312.5,"DT")
3150819
"^DD",9000010.11,9000010.11,1313,0)
DOSE UNITS^P757.5'aO^LEX(757.5,^13;13^Q
"^DD",9000010.11,9000010.11,1313,2)
S Y(0)=Y S:Y Y=$P($$UCUMCODE^LEXMUCUM(Y),"^")
"^DD",9000010.11,9000010.11,1313,2.1)
S:Y Y=$P($$UCUMCODE^LEXMUCUM(Y),"^")
"^DD",9000010.11,9000010.11,1313,3)
Enter the units that reflect the actual quantity of the vaccine product administered.
"^DD",9000010.11,9000010.11,1313,21,0)
^.001^2^2^3150819^^
"^DD",9000010.11,9000010.11,1313,21,1,0)
This is the units that reflect the actual quantity of the vaccine product 
"^DD",9000010.11,9000010.11,1313,21,2,0)
administered.
"^DD",9000010.11,9000010.11,1313,"AUDIT")
y
"^DD",9000010.11,9000010.11,1313,"DT")
3150819
"^DD",9000010.11,9000010.11,1401,0)
RESULTS^Sa^T:TAKE;N:NO TAKE;I:INDETERMINATE;^14;1^Q
"^DD",9000010.11,9000010.11,1401,.1)
Inoculation Results
"^DD",9000010.11,9000010.11,1401,3)
Enter whether the results were Take, No Take or Indeterminate.
"^DD",9000010.11,9000010.11,1401,21,0)
^.001^1^1^3150522^^
"^DD",9000010.11,9000010.11,1401,21,1,0)
This is the interpretation of the inoculation result.
"^DD",9000010.11,9000010.11,1401,"AUDIT")
y
"^DD",9000010.11,9000010.11,1401,"DT")
3150522
"^DD",9000010.11,9000010.11,1402,0)
READING^NJ2,0a^^14;2^K:+X'=X!(X>40)!(X<0)!(X?.E1"."1N.N) X
"^DD",9000010.11,9000010.11,1402,.1)
Reading in Millimeters (mm)
"^DD",9000010.11,9000010.11,1402,1,0)
^.1
"^DD",9000010.11,9000010.11,1402,1,1,0)
9000010.11^AE
"^DD",9000010.11,9000010.11,1402,1,1,1)
S ^AUPNVIMM("AE",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.11,1402,1,1,2)
K ^AUPNVIMM("AE",$E(X,1,30),DA)
"^DD",9000010.11,9000010.11,1402,1,1,"%D",0)
^^2^2^3150127^
"^DD",9000010.11,9000010.11,1402,1,1,"%D",1,0)
This cross reference searches on the inoculation results across all 
"^DD",9000010.11,9000010.11,1402,1,1,"%D",2,0)
patients.
"^DD",9000010.11,9000010.11,1402,1,1,"DT")
3150127
"^DD",9000010.11,9000010.11,1402,3)
Enter a whole number between 0 and 40.
"^DD",9000010.11,9000010.11,1402,21,0)
^^1^1^3150126^
"^DD",9000010.11,9000010.11,1402,21,1,0)
This is the objective, measurable reading following the inoculation.
"^DD",9000010.11,9000010.11,1402,"AUDIT")
y
"^DD",9000010.11,9000010.11,1402,"DT")
3150127
"^DD",9000010.11,9000010.11,1403,0)
DATE/TIME READ^DXa^^14;3^S %DT="ET" D ^%DT S X=Y K:Y<1!$$TIME^PXVUTL X
"^DD",9000010.11,9000010.11,1403,.1)
Reading Date/Time
"^DD",9000010.11,9000010.11,1403,1,0)
^.1^^-1
"^DD",9000010.11,9000010.11,1403,1,1,0)
^^TRIGGER^9000010.11^1405
"^DD",9000010.11,9000010.11,1403,1,1,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVIMM(D0,14)):^(14),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X=DIV N %I,%H,% D NOW^%DTC S X=% X ^DD(9000010.11,1403,1,1,1.4)
"^DD",9000010.11,9000010.11,1403,1,1,1.4)
S DIH=$G(^AUPNVIMM(DIV(0),14)),DIV=X S $P(^(14),U,5)=DIV,DIH=9000010.11,DIG=1405 D ^DICR
"^DD",9000010.11,9000010.11,1403,1,1,2)
Q
"^DD",9000010.11,9000010.11,1403,1,1,"CREATE VALUE")
NOW
"^DD",9000010.11,9000010.11,1403,1,1,"DELETE VALUE")
NO EFFECT
"^DD",9000010.11,9000010.11,1403,1,1,"FIELD")
READING RECORDED
"^DD",9000010.11,9000010.11,1403,3)
Enter the date and (optional) time the immunization was read.
"^DD",9000010.11,9000010.11,1403,21,0)
^^3^3^3150820^
"^DD",9000010.11,9000010.11,1403,21,1,0)
This is the date and time of the reading of the immunization results.
"^DD",9000010.11,9000010.11,1403,21,2,0)
Time entry is optional and imprecise date is allowed for historical
"^DD",9000010.11,9000010.11,1403,21,3,0)
immunizations.
"^DD",9000010.11,9000010.11,1403,"AUDIT")
y
"^DD",9000010.11,9000010.11,1403,"DT")
3150820
"^DD",9000010.11,9000010.11,1404,0)
READER^P200'a^VA(200,^14;4^Q
"^DD",9000010.11,9000010.11,1404,.1)
Reader of Inoculation Results
"^DD",9000010.11,9000010.11,1404,3)
Enter the name of the person who read the inoculation results.
"^DD",9000010.11,9000010.11,1404,21,0)
^.001^2^2^3150127^^
"^DD",9000010.11,9000010.11,1404,21,1,0)
This is the name of the person who read and interpreted the results of 
"^DD",9000010.11,9000010.11,1404,21,2,0)
the inoculation.
"^DD",9000010.11,9000010.11,1404,"AUDIT")
y
"^DD",9000010.11,9000010.11,1404,"DT")
3150127
"^DD",9000010.11,9000010.11,1405,0)
READING RECORDED^Da^^14;5^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.11,9000010.11,1405,.1)
Date/Time Reading is Recorded
"^DD",9000010.11,9000010.11,1405,3)
Enter the date and time of the reading of the inoculation results.
"^DD",9000010.11,9000010.11,1405,5,1,0)
9000010.11^1403^1
"^DD",9000010.11,9000010.11,1405,9)
^
"^DD",9000010.11,9000010.11,1405,21,0)
^^3^3^3150127^
"^DD",9000010.11,9000010.11,1405,21,1,0)
This timestamp field is the date and time of documentation of reading of 
"^DD",9000010.11,9000010.11,1405,21,2,0)
the inoculation results. This field is set automatically when the 
"^DD",9000010.11,9000010.11,1405,21,3,0)
DATE/TIME READ is entered.
"^DD",9000010.11,9000010.11,1405,"AUDIT")
y
"^DD",9000010.11,9000010.11,1405,"DT")
3150127
"^DD",9000010.11,9000010.11,1406,0)
HOURS READ POST-INOCULATION^NJ3,0a^^14;6^K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X
"^DD",9000010.11,9000010.11,1406,.1)
Hours Between Inoculation and Reading
"^DD",9000010.11,9000010.11,1406,3)
Type a number between 0 and 100, 0 decimal digits.
"^DD",9000010.11,9000010.11,1406,21,0)
^^2^2^3150127^
"^DD",9000010.11,9000010.11,1406,21,1,0)
This is the number of hours between the inoculation and the reading of 
"^DD",9000010.11,9000010.11,1406,21,2,0)
the results.
"^DD",9000010.11,9000010.11,1406,"AUDIT")
y
"^DD",9000010.11,9000010.11,1406,"DT")
3150818
"^DD",9000010.11,9000010.11,1501,0)
READING COMMENT^Fa^^15;1^K:$L(X)>245!($L(X)<1) X
"^DD",9000010.11,9000010.11,1501,3)
Enter a reading comment 1-245 characters in length.
"^DD",9000010.11,9000010.11,1501,21,0)
^^2^2^3150128^
"^DD",9000010.11,9000010.11,1501,21,1,0)
This is a comment related to the reading of the patient's inoculation. 
"^DD",9000010.11,9000010.11,1501,21,2,0)
The provider may enter this manually via the PCE User Interface.
"^DD",9000010.11,9000010.11,1501,"AUDIT")
y
"^DD",9000010.11,9000010.11,1501,"DT")
3150128
"^DD",9000010.11,9000010.11,2601,0)
SNOMED CT^9000010.1126A^^26;0
"^DD",9000010.11,9000010.11,2601,21,0)
^.001^2^2^3140829^^^
"^DD",9000010.11,9000010.11,2601,21,1,0)
This Indian Health Service field indicates the SNOMED Clinical Terms (CT)
"^DD",9000010.11,9000010.11,2601,21,2,0)
that describe this immunization and their preferred terms.
"^DD",9000010.11,9000010.11,2601,23,0)
^.001^3^3^3140829^^
"^DD",9000010.11,9000010.11,2601,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,2601,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,2601,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,2701,0)
LOINC CODES^9000010.1127A^^27;0
"^DD",9000010.11,9000010.11,2701,21,0)
^.001^2^2^3140829^^
"^DD",9000010.11,9000010.11,2701,21,1,0)
This Indian Health Service field is the LOINC codes that identifies this
"^DD",9000010.11,9000010.11,2701,21,2,0)
immunization, along with their descriptions.
"^DD",9000010.11,9000010.11,2701,23,0)
^.001^3^3^3140829^^
"^DD",9000010.11,9000010.11,2701,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.11,2701,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.11,2701,23,3,0)
of the file.
"^DD",9000010.11,9000010.11,80101,0)
EDITED FLAG^Sa^1:EDITED;^801;1^Q
"^DD",9000010.11,9000010.11,80101,3)
Enter 1 if the original immunization data is being edited.
"^DD",9000010.11,9000010.11,80101,21,0)
^.001^2^2^3150813^^^
"^DD",9000010.11,9000010.11,80101,21,1,0)
This field is automatically set to 1 if PCE detects that any original
"^DD",9000010.11,9000010.11,80101,21,2,0)
immunization data is being edited.
"^DD",9000010.11,9000010.11,80101,23,0)
^.001^2^2^3150813^^^
"^DD",9000010.11,9000010.11,80101,23,1,0)
PCE filing logic automatically compares the before and after pictures of the
"^DD",9000010.11,9000010.11,80101,23,2,0)
record to determine if the edited flag should be set to "1".
"^DD",9000010.11,9000010.11,80101,"AUDIT")
y
"^DD",9000010.11,9000010.11,80101,"DT")
3150213
"^DD",9000010.11,9000010.11,80102,0)
AUDIT TRAIL^Fa^^801;2^K:$L(X)>85!($L(X)<2) X
"^DD",9000010.11,9000010.11,80102,.1)
Audit Trail
"^DD",9000010.11,9000010.11,80102,3)
Answer must be 2 to 85 characters.
"^DD",9000010.11,9000010.11,80102,21,0)
^.001^3^3^3150813^^^^
"^DD",9000010.11,9000010.11,80102,21,1,0)
This field is populated automatically by the PCE filing logic.  The format
"^DD",9000010.11,9000010.11,80102,21,2,0)
of the field is as follows:  Pointer to PCE data source file_"-"_A for Add
"^DD",9000010.11,9000010.11,80102,21,3,0)
or E for Edit_" "_DUZ of the person who entered the data_";"...
"^DD",9000010.11,9000010.11,80102,23,0)
^.001^14^14^3150813^^^^
"^DD",9000010.11,9000010.11,80102,23,1,0)
The PCE filing logic requires a pointer to the PCE data source file.  If this
"^DD",9000010.11,9000010.11,80102,23,2,0)
is not passed, the PCE filing logic will not process the data.
"^DD",9000010.11,9000010.11,80102,23,3,0)
 
"^DD",9000010.11,9000010.11,80102,23,4,0)
If the record is a new record, then an "A" is used to specify the source that
"^DD",9000010.11,9000010.11,80102,23,5,0)
added the data.  If the record existed previously, PCE filing logic compares
"^DD",9000010.11,9000010.11,80102,23,6,0)
the old and new records of information.  An "E" will be automatically used if
"^DD",9000010.11,9000010.11,80102,23,7,0)
the filing logic finds the data has been edited.  If "E" is used, then the
"^DD",9000010.11,9000010.11,80102,23,8,0)
Edited Flag field is automatically set to 1.
"^DD",9000010.11,9000010.11,80102,23,9,0)
 
"^DD",9000010.11,9000010.11,80102,23,10,0)
The DUZ is stored in its internal format to represent the user who performed
"^DD",9000010.11,9000010.11,80102,23,11,0)
the adding or editing of data for this record.
"^DD",9000010.11,9000010.11,80102,23,12,0)
 
"^DD",9000010.11,9000010.11,80102,23,13,0)
Iterations of editing will be concatenated to the previous data source
"^DD",9000010.11,9000010.11,80102,23,14,0)
value, up to 85 characters.
"^DD",9000010.11,9000010.11,80102,"AUDIT")
y
"^DD",9000010.11,9000010.11,80102,"DT")
3150213
"^DD",9000010.11,9000010.11,81101,0)
COMMENTS^Fa^^811;1^K:$L(X)>245!($L(X)<1) X
"^DD",9000010.11,9000010.11,81101,3)
Enter a comment 1-245 characters in length.
"^DD",9000010.11,9000010.11,81101,21,0)
^^2^2^2950901^^
"^DD",9000010.11,9000010.11,81101,21,1,0)
This is a comment related to the patient's immunization.  The provider may enter
"^DD",9000010.11,9000010.11,81101,21,2,0)
this manually via the PCE User Interface.
"^DD",9000010.11,9000010.11,81101,"AUDIT")
y
"^DD",9000010.11,9000010.11,81101,"DT")
3150213
"^DD",9000010.11,9000010.11,81201,0)
VERIFIED^SIa^1:ELECTRONICALLY SIGNED;2:VERIFIED BY PACKAGE;^812;1^Q
"^DD",9000010.11,9000010.11,81201,3)
Enter 1 if verified by electronic signature or 2 if verified by package.
"^DD",9000010.11,9000010.11,81201,21,0)
^.001^2^2^3150813^^^
"^DD",9000010.11,9000010.11,81201,21,1,0)
This is used to note how the event was verified and is automatically
"^DD",9000010.11,9000010.11,81201,21,2,0)
entered by the software.
"^DD",9000010.11,9000010.11,81201,23,0)
^.001^1^1^3150813^^^
"^DD",9000010.11,9000010.11,81201,23,1,0)
This is automatically entered by the software and is uneditable for users.
"^DD",9000010.11,9000010.11,81201,"AUDIT")
y
"^DD",9000010.11,9000010.11,81201,"DT")
3150213
"^DD",9000010.11,9000010.11,81202,0)
PACKAGE^P9.4'Ia^DIC(9.4,^812;2^Q
"^DD",9000010.11,9000010.11,81202,.1)
Package
"^DD",9000010.11,9000010.11,81202,3)
Enter the VistA package from which this record originated.
"^DD",9000010.11,9000010.11,81202,21,0)
^^4^4^3150813^
"^DD",9000010.11,9000010.11,81202,21,1,0)
This is the VistA package from which this immunization record 
"^DD",9000010.11,9000010.11,81202,21,2,0)
originated through PCE.
"^DD",9000010.11,9000010.11,81202,21,3,0)
 
"^DD",9000010.11,9000010.11,81202,21,4,0)
This is automatically entered by the software and uneditable by users.
"^DD",9000010.11,9000010.11,81202,"AUDIT")
y
"^DD",9000010.11,9000010.11,81202,"DT")
3150813
"^DD",9000010.11,9000010.11,81203,0)
DATA SOURCE^P839.7'Ia^PX(839.7,^812;3^Q
"^DD",9000010.11,9000010.11,81203,3)
Select the data source for this immunization entry through PCE.
"^DD",9000010.11,9000010.11,81203,21,0)
^.001^2^2^3150213^^^
"^DD",9000010.11,9000010.11,81203,21,1,0)
This is the data source for this immunization, automatically entered 
"^DD",9000010.11,9000010.11,81203,21,2,0)
through the PCS software and uneditable by users.
"^DD",9000010.11,9000010.11,81203,"AUDIT")
y
"^DD",9000010.11,9000010.11,81203,"DT")
3150213
"^DD",9000010.11,9000010.1111,0)
REMARKS SUB-FIELD^^.01^1
"^DD",9000010.11,9000010.1111,0,"NM","REMARKS")

"^DD",9000010.11,9000010.1111,0,"UP")
9000010.11
"^DD",9000010.11,9000010.1111,.01,0)
REMARKS^W^^0;1^Q
"^DD",9000010.11,9000010.1111,.01,3)
Enter comments related to the immunization encounter with the patient.
"^DD",9000010.11,9000010.1111,.01,21,0)
^^2^2^2950901^
"^DD",9000010.11,9000010.1111,.01,21,1,0)
This field can be used to enter comments related to the immunization
"^DD",9000010.11,9000010.1111,.01,21,2,0)
encounter with the patient.
"^DD",9000010.11,9000010.1111,.01,"DT")
2861007
"^DD",9000010.11,9000010.112,0)
VIS OFFERED/GIVEN TO PATIENT SUB-FIELD^^.02^2
"^DD",9000010.11,9000010.112,0,"DT")
3150518
"^DD",9000010.11,9000010.112,0,"IX","B",9000010.112,.01)

"^DD",9000010.11,9000010.112,0,"IX","D",9000010.112,.02)

"^DD",9000010.11,9000010.112,0,"NM","VIS OFFERED/GIVEN TO PATIENT")

"^DD",9000010.11,9000010.112,0,"UP")
9000010.11
"^DD",9000010.11,9000010.112,.01,0)
VIS OFFERED/GIVEN TO PATIENT^M*P920'a^AUTTIVIS(^0;1^S DIC("S")="I $D(^AUTTIMM($P(^AUPNVIMM(DA,0),""^""),4,""B"",Y))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.11,9000010.112,.01,.1)
VIS Offered/Given to the Patient
"^DD",9000010.11,9000010.112,.01,1,0)
^.1
"^DD",9000010.11,9000010.112,.01,1,1,0)
9000010.112^B
"^DD",9000010.11,9000010.112,.01,1,1,1)
S ^AUPNVIMM(DA(1),2,"B",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.112,.01,1,1,2)
K ^AUPNVIMM(DA(1),2,"B",$E(X,1,30),DA)
"^DD",9000010.11,9000010.112,.01,2)
S Y(0)=Y S Y(0)=Y D VIS^PXVUTIL
"^DD",9000010.11,9000010.112,.01,2.1)
S Y(0)=Y D VIS^PXVUTIL
"^DD",9000010.11,9000010.112,.01,3)
Enter the VIS offered /given to the patient.
"^DD",9000010.11,9000010.112,.01,12)
Screen allows selection of Vaccine Information Statements appropriate for this immunization.
"^DD",9000010.11,9000010.112,.01,12.1)
S DIC("S")="I $D(^AUTTIMM($P(^AUPNVIMM(DA,0),""^""),4,""B"",Y))"
"^DD",9000010.11,9000010.112,.01,21,0)
^.001^2^2^3150518^^^^
"^DD",9000010.11,9000010.112,.01,21,1,0)
This is the name of the Vaccine Information Statement offered to or given 
"^DD",9000010.11,9000010.112,.01,21,2,0)
to the patient before administration of the immunization.
"^DD",9000010.11,9000010.112,.01,"AUDIT")
y
"^DD",9000010.11,9000010.112,.01,"AX")
I $G(DA)>1
"^DD",9000010.11,9000010.112,.01,"DT")
3150518
"^DD",9000010.11,9000010.112,.02,0)
DATE VIS OFFERED/GIVEN^DXa^^0;2^S %DT="EXP" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.11,9000010.112,.02,.1)
Date VIS Offered/Given
"^DD",9000010.11,9000010.112,.02,1,0)
^.1
"^DD",9000010.11,9000010.112,.02,1,1,0)
9000010.112^D
"^DD",9000010.11,9000010.112,.02,1,1,1)
S ^AUPNVIMM(DA(1),2,"D",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.112,.02,1,1,2)
K ^AUPNVIMM(DA(1),2,"D",$E(X,1,30),DA)
"^DD",9000010.11,9000010.112,.02,1,1,3)
USED FOR LOOKUPS
"^DD",9000010.11,9000010.112,.02,1,1,"%D",0)
^^2^2^3150220^
"^DD",9000010.11,9000010.112,.02,1,1,"%D",1,0)
This x-ref is used to do a (reverse) lookup for the latest VIS offered
"^DD",9000010.11,9000010.112,.02,1,1,"%D",2,0)
for this event.
"^DD",9000010.11,9000010.112,.02,1,1,"DT")
3150220
"^DD",9000010.11,9000010.112,.02,3)
Enter the date the VIS was offered/given to the patient.
"^DD",9000010.11,9000010.112,.02,21,0)
^.001^2^2^3140507^^
"^DD",9000010.11,9000010.112,.02,21,1,0)
This is the date the Vaccine Information Statement was offered to or 
"^DD",9000010.11,9000010.112,.02,21,2,0)
given to the patient.
"^DD",9000010.11,9000010.112,.02,"AUDIT")
y
"^DD",9000010.11,9000010.112,.02,"DT")
3150220
"^DD",9000010.11,9000010.1126,0)
SNOMED CT SUB-FIELD^^.019^2
"^DD",9000010.11,9000010.1126,0,"DT")
3130222
"^DD",9000010.11,9000010.1126,0,"IX","B",9000010.1126,.01)

"^DD",9000010.11,9000010.1126,0,"NM","SNOMED CT")

"^DD",9000010.11,9000010.1126,0,"UP")
9000010.11
"^DD",9000010.11,9000010.1126,.01,0)
SNOMED CT^Fa^^0;1^K:$L(X)>30!($L(X)<1) X
"^DD",9000010.11,9000010.1126,.01,1,0)
^.1
"^DD",9000010.11,9000010.1126,.01,1,1,0)
9000010.1126^B
"^DD",9000010.11,9000010.1126,.01,1,1,1)
S ^AUPNVIMM(DA(1),26,"B",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.1126,.01,1,1,2)
K ^AUPNVIMM(DA(1),26,"B",$E(X,1,30),DA)
"^DD",9000010.11,9000010.1126,.01,3)
Answer must be 1-30 characters in length.
"^DD",9000010.11,9000010.1126,.01,21,0)
^^2^2^3140702^^
"^DD",9000010.11,9000010.1126,.01,21,1,0)
This Indian Health Service field indicates a SNOMED Clinical Term (CT)
"^DD",9000010.11,9000010.1126,.01,21,2,0)
that describes this immunization.
"^DD",9000010.11,9000010.1126,.01,23,0)
^^3^3^3140701^^
"^DD",9000010.11,9000010.1126,.01,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.1126,.01,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.1126,.01,23,3,0)
of the file.
"^DD",9000010.11,9000010.1126,.01,"AUDIT")
y
"^DD",9000010.11,9000010.1126,.01,"DT")
3140702
"^DD",9000010.11,9000010.1126,.019,0)
SNOMED PREFERRED TERM^CJ8^^ ; ^S Y(9000010.1126,.019,1)=$S($D(^AUPNVIMM(D0,26,D1,0)):^(0),1:"") S X=$P(Y(9000010.1126,.019,1),U,1),X=$$CONCPT^AUPNVUTL(X)
"^DD",9000010.11,9000010.1126,.019,9)
^
"^DD",9000010.11,9000010.1126,.019,9.01)
9000010.1126^.01
"^DD",9000010.11,9000010.1126,.019,9.1)
AUPNPT(#.01)
"^DD",9000010.11,9000010.1126,.019,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.1126,.019,21,1,0)
This Indian Health Service field is a preferred term describing the
"^DD",9000010.11,9000010.1126,.019,21,2,0)
associated SNOMED clinical term.
"^DD",9000010.11,9000010.1126,.019,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.1126,.019,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.1126,.019,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.1126,.019,23,3,0)
of the file.
"^DD",9000010.11,9000010.1126,.019,"DT")
3140702
"^DD",9000010.11,9000010.1127,0)
LOINC CODES SUB-FIELD^^.019^2
"^DD",9000010.11,9000010.1127,0,"DT")
3130222
"^DD",9000010.11,9000010.1127,0,"IX","B",9000010.1127,.01)

"^DD",9000010.11,9000010.1127,0,"NM","LOINC CODES")

"^DD",9000010.11,9000010.1127,0,"UP")
9000010.11
"^DD",9000010.11,9000010.1127,.01,0)
LOINC CODES^Fa^^0;1^K:$L(X)>30!($L(X)<1) X
"^DD",9000010.11,9000010.1127,.01,1,0)
^.1
"^DD",9000010.11,9000010.1127,.01,1,1,0)
9000010.1127^B
"^DD",9000010.11,9000010.1127,.01,1,1,1)
S ^AUPNVIMM(DA(1),27,"B",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.1127,.01,1,1,2)
K ^AUPNVIMM(DA(1),27,"B",$E(X,1,30),DA)
"^DD",9000010.11,9000010.1127,.01,3)
Answer must be 1-30 characters in length.
"^DD",9000010.11,9000010.1127,.01,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.1127,.01,21,1,0)
This Indian Health Service field is a LOINC code that identifies this
"^DD",9000010.11,9000010.1127,.01,21,2,0)
immunization.
"^DD",9000010.11,9000010.1127,.01,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.1127,.01,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.1127,.01,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.1127,.01,23,3,0)
of the file.
"^DD",9000010.11,9000010.1127,.01,"AUDIT")
y
"^DD",9000010.11,9000010.1127,.01,"DT")
3140702
"^DD",9000010.11,9000010.1127,.019,0)
LOINC TEXT^CJ8^^ ; ^S Y(9000010.1127,.019,1)=$S($D(^AUPNVIMM(D0,27,D1,0)):^(0),1:"") S X=$P(Y(9000010.1127,.019,1),U,1),X=$$LOINCPT^AUPNVUTL(X)
"^DD",9000010.11,9000010.1127,.019,9)
^
"^DD",9000010.11,9000010.1127,.019,9.01)
9000010.1127^.01
"^DD",9000010.11,9000010.1127,.019,9.1)
AUPNLOINCPT(#.01)
"^DD",9000010.11,9000010.1127,.019,21,0)
^^2^2^3140702^
"^DD",9000010.11,9000010.1127,.019,21,1,0)
This Indian Health Service field is LOINC text describing the associated
"^DD",9000010.11,9000010.1127,.019,21,2,0)
LOINC code.
"^DD",9000010.11,9000010.1127,.019,23,0)
^^3^3^3140625^
"^DD",9000010.11,9000010.1127,.019,23,1,0)
This field is not used by the Department of Veterans Affairs.   It is
"^DD",9000010.11,9000010.1127,.019,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9000010.11,9000010.1127,.019,23,3,0)
of the file.
"^DD",9000010.11,9000010.1127,.019,"DT")
3140702
"^DD",9000010.11,9000010.113,0)
OTHER DIAGNOSIS SUB-FIELD^^.01^1
"^DD",9000010.11,9000010.113,0,"DT")
3140701
"^DD",9000010.11,9000010.113,0,"IX","B",9000010.113,.01)

"^DD",9000010.11,9000010.113,0,"NM","OTHER DIAGNOSIS")

"^DD",9000010.11,9000010.113,0,"UP")
9000010.11
"^DD",9000010.11,9000010.113,.01,0)
OTHER DIAGNOSIS^M*P80'aX^ICD9(^0;1^S DIC("S")="D RSETDA^PXVUTIL" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
"^DD",9000010.11,9000010.113,.01,.1)
Other Diagnosis
"^DD",9000010.11,9000010.113,.01,1,0)
^.1
"^DD",9000010.11,9000010.113,.01,1,1,0)
9000010.113^B
"^DD",9000010.11,9000010.113,.01,1,1,1)
S ^AUPNVIMM(DA(1),3,"B",$E(X,1,30),DA)=""
"^DD",9000010.11,9000010.113,.01,1,1,2)
K ^AUPNVIMM(DA(1),3,"B",$E(X,1,30),DA)
"^DD",9000010.11,9000010.113,.01,3)
Select a diagnosis for this immunization event.
"^DD",9000010.11,9000010.113,.01,12)
Selection must be appropriate and active.
"^DD",9000010.11,9000010.113,.01,12.1)
S DIC("S")="D RSETDA^PXVUTIL"
"^DD",9000010.11,9000010.113,.01,21,0)
^.001^3^3^3140620^^
"^DD",9000010.11,9000010.113,.01,21,1,0)
This is a diagnosis for this immunization event, in addition to the
"^DD",9000010.11,9000010.113,.01,21,2,0)
PRIMARY DIAGNOSIS.  A primary diagnosis should be selected before
"^DD",9000010.11,9000010.113,.01,21,3,0)
selecting one here.
"^DD",9000010.11,9000010.113,.01,23,0)
^^3^3^3140620^
"^DD",9000010.11,9000010.113,.01,23,1,0)
This is a diagnosis for this immunization event.  It is in addition to the
"^DD",9000010.11,9000010.113,.01,23,2,0)
PRIMARY DIAGNOSIS for this event.  This diagnosis is selected from the
"^DD",9000010.11,9000010.113,.01,23,3,0)
ICD DIAGNOSIS file (#80).
"^DD",9000010.11,9000010.113,.01,"AUDIT")
y
"^DD",9000010.11,9000010.113,.01,"AX")

"^DD",9000010.11,9000010.113,.01,"DT")
3140821
"^DD",9000010.12,9000010.12,0)
FIELD^^808^30
"^DD",9000010.12,9000010.12,0,"DDA")
N
"^DD",9000010.12,9000010.12,0,"DT")
3150813
"^DD",9000010.12,9000010.12,0,"ID",.02)
W "   ",$S($D(^DPT(+$P(^(0),U,2),0))#2:$P(^(0),U,1),1:""),@("$E("_DIC_"Y,0),0)")
"^DD",9000010.12,9000010.12,0,"ID",.03)
W "   " S AIHSY=Y,Y=$S($D(^AUPNVSIT(+$P(^(0),U,3),0))#2:$P(^(0),U,1),1:"") X:Y ^DD("DD") W Y S Y=AIHSY K AIHSY W @("$E("_DIC_"Y,0),0)")
"^DD",9000010.12,9000010.12,0,"IX","AA",9000010.12,.03)

"^DD",9000010.12,9000010.12,0,"IX","AATOO",9000010.12,.01)

"^DD",9000010.12,9000010.12,0,"IX","AATOO2",9000010.12,.02)

"^DD",9000010.12,9000010.12,0,"IX","AC",9000010.12,.01)

"^DD",9000010.12,9000010.12,0,"IX","AD",9000010.12,.03)

"^DD",9000010.12,9000010.12,0,"IX","AE",9000010.12,.05)

"^DD",9000010.12,9000010.12,0,"IX","AV10",9000010.12,.03)

"^DD",9000010.12,9000010.12,0,"IX","B",9000010.12,.01)

"^DD",9000010.12,9000010.12,0,"IX","C",9000010.12,.02)

"^DD",9000010.12,9000010.12,0,"NM","V SKIN TEST")

"^DD",9000010.12,9000010.12,.01,0)
SKIN TEST^R*P9999999.28'a^AUTTSK(^0;1^S DIC("S")="I $P(^(0),U,3)'=1" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,.01,1,0)
^.1
"^DD",9000010.12,9000010.12,.01,1,1,0)
9000010.12^B
"^DD",9000010.12,9000010.12,.01,1,1,1)
S ^AUPNVSK("B",$E(X,1,30),DA)=""
"^DD",9000010.12,9000010.12,.01,1,1,2)
K ^AUPNVSK("B",$E(X,1,30),DA)
"^DD",9000010.12,9000010.12,.01,1,3,0)
9000010.12^AATOO^MUMPS
"^DD",9000010.12,9000010.12,.01,1,3,1)
I $P(^AUPNVSK(DA,0),U,2)]"",$P(^(0),U,3)]"" S ^AUPNVSK("AA",$P(^AUPNVSK(DA,0),U,2),X,(9999999-$P(+^AUPNVSIT($P(^AUPNVSK(DA,0),U,3),0),".",1)),DA)=""
"^DD",9000010.12,9000010.12,.01,1,3,2)
I $P(^AUPNVSK(DA,0),U,2)]"",$P(^(0),U,3)]"" K ^AUPNVSK("AA",$P(^AUPNVSK(DA,0),U,2),X,(9999999-$P(+^AUPNVSIT($P(^AUPNVSK(DA,0),U,3),0),".",1)),DA)
"^DD",9000010.12,9000010.12,.01,1,3,"%D",0)
^^4^4^2950901^
"^DD",9000010.12,9000010.12,.01,1,3,"%D",1,0)
This cross reference is used for searches in sequence by patient, Skin
"^DD",9000010.12,9000010.12,.01,1,3,"%D",2,0)
test pointer, inverted Visit date, and internal entry number.
"^DD",9000010.12,9000010.12,.01,1,3,"%D",3,0)
 
"^DD",9000010.12,9000010.12,.01,1,3,"%D",4,0)
    "AA",PATIENT,SKIN TEST,VISIT,DA
"^DD",9000010.12,9000010.12,.01,1,4,0)
9000010.12^AC^MUMPS
"^DD",9000010.12,9000010.12,.01,1,4,1)
D CODSYS^PXVUTL Q
"^DD",9000010.12,9000010.12,.01,1,4,2)
D KCODSYS^PXVUTL Q
"^DD",9000010.12,9000010.12,.01,1,4,"%D",0)
^.101^3^3^3150218^^
"^DD",9000010.12,9000010.12,.01,1,4,"%D",1,0)
This cross reference maintains the CODING SYSTEM multiple with the
"^DD",9000010.12,9000010.12,.01,1,4,"%D",2,0)
current CODING SYSTEM information stored for this skin test in the SKIN
"^DD",9000010.12,9000010.12,.01,1,4,"%D",3,0)
TEST file (#9999999.28).
"^DD",9000010.12,9000010.12,.01,1,4,"DT")
3150218
"^DD",9000010.12,9000010.12,.01,3)
Enter the Skin Test that was given to the patient.
"^DD",9000010.12,9000010.12,.01,12)
Allow only active Skin Test types to be selected.
"^DD",9000010.12,9000010.12,.01,12.1)
S DIC("S")="I $P(^(0),U,3)'=1"
"^DD",9000010.12,9000010.12,.01,21,0)
^.001^2^2^3150421^^^^
"^DD",9000010.12,9000010.12,.01,21,1,0)
This is the type of Skin Test that was given to the patient at the
"^DD",9000010.12,9000010.12,.01,21,2,0)
encounter.  
"^DD",9000010.12,9000010.12,.01,23,0)
^.001^2^2^3150421^^^^
"^DD",9000010.12,9000010.12,.01,23,1,0)
Only active Skin Test entries in the Skin Test File (#9999999.28) are
"^DD",9000010.12,9000010.12,.01,23,2,0)
 selectable.
"^DD",9000010.12,9000010.12,.01,"AUDIT")
y
"^DD",9000010.12,9000010.12,.01,"DT")
3150421
"^DD",9000010.12,9000010.12,.02,0)
PATIENT NAME^RP9000001'Ia^AUPNPAT(^0;2^Q
"^DD",9000010.12,9000010.12,.02,1,0)
^.1
"^DD",9000010.12,9000010.12,.02,1,2,0)
9000010.12^AATOO2^MUMPS
"^DD",9000010.12,9000010.12,.02,1,2,1)
I $P(^AUPNVSK(DA,0),U,3)]"" S ^AUPNVSK("AA",X,+^AUPNVSK(DA,0),(9999999-$P(+^AUPNVSIT($P(^AUPNVSK(DA,0),U,3),0),".",1)),DA)=""
"^DD",9000010.12,9000010.12,.02,1,2,2)
I $P(^AUPNVSK(DA,0),U,3)]"" K ^AUPNVSK("AA",X,+^AUPNVSK(DA,0),(9999999-$P(+^AUPNVSIT($P(^AUPNVSK(DA,0),U,3),0),".",1)),DA)
"^DD",9000010.12,9000010.12,.02,1,2,"%D",0)
^^4^4^2950901^
"^DD",9000010.12,9000010.12,.02,1,2,"%D",1,0)
This cross reference is used to search in sequence by patient, skin test
"^DD",9000010.12,9000010.12,.02,1,2,"%D",2,0)
pointer, inverted visit date, and internal entry number.
"^DD",9000010.12,9000010.12,.02,1,2,"%D",3,0)
 
"^DD",9000010.12,9000010.12,.02,1,2,"%D",4,0)
  "AA",PATIENT,SKIN TEST,VISIT,DA
"^DD",9000010.12,9000010.12,.02,1,3,0)
9000010.12^C
"^DD",9000010.12,9000010.12,.02,1,3,1)
S ^AUPNVSK("C",$E(X,1,30),DA)=""
"^DD",9000010.12,9000010.12,.02,1,3,2)
K ^AUPNVSK("C",$E(X,1,30),DA)
"^DD",9000010.12,9000010.12,.02,1,3,"%D",0)
^^1^1^2950901^
"^DD",9000010.12,9000010.12,.02,1,3,"%D",1,0)
This cross reference allows look-up by patient name.
"^DD",9000010.12,9000010.12,.02,1,3,"DT")
2950901
"^DD",9000010.12,9000010.12,.02,3)
Enter the patient who was given the skin test.
"^DD",9000010.12,9000010.12,.02,21,0)
^^1^1^2950901^
"^DD",9000010.12,9000010.12,.02,21,1,0)
This is the patient who received the skin test.
"^DD",9000010.12,9000010.12,.02,23,0)
^^3^3^2950901^
"^DD",9000010.12,9000010.12,.02,23,1,0)
This is a pointer to the Patient/IHS file (#9000001) which is dinumed to
"^DD",9000010.12,9000010.12,.02,23,2,0)
the Patient File (#2).  This field is always stuffed by the application.
"^DD",9000010.12,9000010.12,.02,23,3,0)
No editing is allowed.
"^DD",9000010.12,9000010.12,.02,"AUDIT")
y
"^DD",9000010.12,9000010.12,.02,"DT")
3150213
"^DD",9000010.12,9000010.12,.03,0)
VISIT^R*P9000010'Ia^AUPNVSIT(^0;3^S DIC("S")="I $P(^(0),U,5)=$P(^AUPNVSK(DA,0),U,2)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,.03,1,0)
^.1
"^DD",9000010.12,9000010.12,.03,1,1,0)
9000010.12^AD
"^DD",9000010.12,9000010.12,.03,1,1,1)
S ^AUPNVSK("AD",$E(X,1,30),DA)=""
"^DD",9000010.12,9000010.12,.03,1,1,2)
K ^AUPNVSK("AD",$E(X,1,30),DA)
"^DD",9000010.12,9000010.12,.03,1,1,"%D",0)
^^1^1^2950901^
"^DD",9000010.12,9000010.12,.03,1,1,"%D",1,0)
This cross reference allows look-up of entries by patient name.
"^DD",9000010.12,9000010.12,.03,1,2,0)
9000010.12^AA^MUMPS
"^DD",9000010.12,9000010.12,.03,1,2,1)
Q:$P(^AUPNVSK(DA,0),U,2)=""  S ^AUPNVSK("AA",$P(^AUPNVSK(DA,0),U,2),+^AUPNVSK(DA,0),(9999999-$P(+^AUPNVSIT(X,0),".",1)),DA)=""
"^DD",9000010.12,9000010.12,.03,1,2,2)
Q:$P(^AUPNVSK(DA,0),U,2)=""  K ^AUPNVSK("AA",$P(^AUPNVSK(DA,0),U,2),+^AUPNVSK(DA,0),(9999999-$P(+^AUPNVSIT(X,0),".",1)),DA)
"^DD",9000010.12,9000010.12,.03,1,2,"%D",0)
^^4^4^2950901^
"^DD",9000010.12,9000010.12,.03,1,2,"%D",1,0)
This cross reference is used for searches in sequence by patient, skin
"^DD",9000010.12,9000010.12,.03,1,2,"%D",2,0)
test pointer, inverted visit date, and internal entry number.
"^DD",9000010.12,9000010.12,.03,1,2,"%D",3,0)
 
"^DD",9000010.12,9000010.12,.03,1,2,"%D",4,0)
    "AA",PATIENT,SKIN TEST,VISIT,DA
"^DD",9000010.12,9000010.12,.03,1,3,0)
9000010.12^AV10^MUMPS
"^DD",9000010.12,9000010.12,.03,1,3,1)
D ADD^AUPNVSIT
"^DD",9000010.12,9000010.12,.03,1,3,2)
D SUB^AUPNVSIT
"^DD",9000010.12,9000010.12,.03,1,3,"%D",0)
^^2^2^2940127^
"^DD",9000010.12,9000010.12,.03,1,3,"%D",1,0)
This cross-reference is for adding and subtracting from the dependent
"^DD",9000010.12,9000010.12,.03,1,3,"%D",2,0)
entry count in the VISIT file.
"^DD",9000010.12,9000010.12,.03,3)
Enter the visit date/time for the encounter where the skin test was done.
"^DD",9000010.12,9000010.12,.03,12)
VISIT MUST BE FOR CURRENT PATIENT
"^DD",9000010.12,9000010.12,.03,12.1)
S DIC("S")="I $P(^(0),U,5)=$P(^AUPNVSK(DA,0),U,2)"
"^DD",9000010.12,9000010.12,.03,21,0)
^^2^2^2950901^
"^DD",9000010.12,9000010.12,.03,21,1,0)
This is the encounter defined in the Visit file that represents when and
"^DD",9000010.12,9000010.12,.03,21,2,0)
where the skin test was done.
"^DD",9000010.12,9000010.12,.03,23,0)
^^2^2^2950901^
"^DD",9000010.12,9000010.12,.03,23,1,0)
This is a pointer to the Visit File (#9000010).  This field is stuffed by
"^DD",9000010.12,9000010.12,.03,23,2,0)
the applications.  No editing is allowed.
"^DD",9000010.12,9000010.12,.03,"AUDIT")
y
"^DD",9000010.12,9000010.12,.03,"DT")
3150213
"^DD",9000010.12,9000010.12,.04,0)
RESULTS^SXa^P:POSITIVE;N:NEGATIVE;D:DOUBTFUL;O:NO TAKE;^0;4^I X="N",$P(^AUPNVSK(DA,0),U,5)]"",$P(^AUPNVSK(DA,0),U,5)>10 K X
"^DD",9000010.12,9000010.12,.04,.1)
Test Interpretation
"^DD",9000010.12,9000010.12,.04,1,0)
^.1^^0
"^DD",9000010.12,9000010.12,.04,3)
Enter whether the results were positive, negative, doubtful or no take, if known.
"^DD",9000010.12,9000010.12,.04,10)
082/SKREST
"^DD",9000010.12,9000010.12,.04,21,0)
^^1^1^3150126^
"^DD",9000010.12,9000010.12,.04,21,1,0)
This is the interpretation of skin test results.
"^DD",9000010.12,9000010.12,.04,"AUDIT")
y
"^DD",9000010.12,9000010.12,.04,"DT")
3150213
"^DD",9000010.12,9000010.12,.05,0)
READING^NJ2,0Xa^^0;5^K:+X'=X!(X>40)!(X<0)!(X?.E1"."1N.N) X
"^DD",9000010.12,9000010.12,.05,.1)
Reading in Millimeters (mm)
"^DD",9000010.12,9000010.12,.05,1,0)
^.1^^-1
"^DD",9000010.12,9000010.12,.05,1,2,0)
9000010.12^AE
"^DD",9000010.12,9000010.12,.05,1,2,1)
S ^AUPNVSK("AE",$E(X,1,30),DA)=""
"^DD",9000010.12,9000010.12,.05,1,2,2)
K ^AUPNVSK("AE",$E(X,1,30),DA)
"^DD",9000010.12,9000010.12,.05,1,2,"%D",0)
^^4^4^2950901^
"^DD",9000010.12,9000010.12,.05,1,2,"%D",1,0)
This cross-reference searches on the results of skin tests across all
"^DD",9000010.12,9000010.12,.05,1,2,"%D",2,0)
patients.
"^DD",9000010.12,9000010.12,.05,1,2,"%D",3,0)
 
"^DD",9000010.12,9000010.12,.05,1,2,"%D",4,0)
   "AE",READING,DA
"^DD",9000010.12,9000010.12,.05,3)
Enter a whole number between 0 and 40.
"^DD",9000010.12,9000010.12,.05,10)
082/SKREAD
"^DD",9000010.12,9000010.12,.05,21,0)
^.001^1^1^3150126^^^
"^DD",9000010.12,9000010.12,.05,21,1,0)
This is the induration in millimeters (mm).
"^DD",9000010.12,9000010.12,.05,"AUDIT")
y
"^DD",9000010.12,9000010.12,.05,"DT")
3150213
"^DD",9000010.12,9000010.12,.06,0)
DATE READ^DXa^^0;6^S %DT="ET" D ^%DT S X=Y K:Y<1!$$TIME^PXVUTL X
"^DD",9000010.12,9000010.12,.06,.1)
Reading Date/Time
"^DD",9000010.12,9000010.12,.06,1,0)
^.1^^-1
"^DD",9000010.12,9000010.12,.06,1,1,0)
^^TRIGGER^9000010.12^1220
"^DD",9000010.12,9000010.12,.06,1,1,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVSK(D0,12)):^(12),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X=DIV N %I,%H,% D NOW^%DTC S X=% X ^DD(9000010.12,.06,1,1,1.4)
"^DD",9000010.12,9000010.12,.06,1,1,1.4)
S DIH=$G(^AUPNVSK(DIV(0),12)),DIV=X S $P(^(12),U,20)=DIV,DIH=9000010.12,DIG=1220 D ^DICR
"^DD",9000010.12,9000010.12,.06,1,1,2)
Q
"^DD",9000010.12,9000010.12,.06,1,1,"%D",0)
^^2^2^3150728^
"^DD",9000010.12,9000010.12,.06,1,1,"%D",1,0)
This trigger sets the SKIN TEST READING RECORDED field (#1220) when the 
"^DD",9000010.12,9000010.12,.06,1,1,"%D",2,0)
DATE READ is entered.
"^DD",9000010.12,9000010.12,.06,1,1,"CREATE VALUE")
NOW
"^DD",9000010.12,9000010.12,.06,1,1,"DELETE VALUE")
NO EFFECT
"^DD",9000010.12,9000010.12,.06,1,1,"DT")
3150728
"^DD",9000010.12,9000010.12,.06,1,1,"FIELD")
SKIN TEST READING RECORDED
"^DD",9000010.12,9000010.12,.06,3)
Enter the date and (optional) time the skin test was read.
"^DD",9000010.12,9000010.12,.06,21,0)
^^2^2^3150820^
"^DD",9000010.12,9000010.12,.06,21,1,0)
This is the date and time of the reading of the skin test. Time entry is
"^DD",9000010.12,9000010.12,.06,21,2,0)
optional and imprecise date is allowed for historical skin tests.
"^DD",9000010.12,9000010.12,.06,"AUDIT")
y
"^DD",9000010.12,9000010.12,.06,"DT")
3150820
"^DD",9000010.12,9000010.12,.07,0)
READER^P200'a^VA(200,^0;7^Q
"^DD",9000010.12,9000010.12,.07,3)
Enter the name of the person who read the skin test.
"^DD",9000010.12,9000010.12,.07,21,0)
^^2^2^3141216^
"^DD",9000010.12,9000010.12,.07,21,1,0)
This is the name of the person who read and interpreted the results of 
"^DD",9000010.12,9000010.12,.07,21,2,0)
the skin test.
"^DD",9000010.12,9000010.12,.07,"AUDIT")
y
"^DD",9000010.12,9000010.12,.07,"DT")
3150213
"^DD",9000010.12,9000010.12,3,0)
CODING SYSTEM^9000010.123^^3;0
"^DD",9000010.12,9000010.12,3,21,0)
^.001^2^2^3150213^^
"^DD",9000010.12,9000010.12,3,21,1,0)
This multiple stores the coding system(s) associated with the codes 
"^DD",9000010.12,9000010.12,3,21,2,0)
identifying this skin test.
"^DD",9000010.12,9000010.12,801,0)
PRIMARY DIAGNOSIS^*P80'a^ICD9(^80;1^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,801,.1)
Primary Diagnosis
"^DD",9000010.12,9000010.12,801,3)
Enter the primary diagnosis code associated with this skin test.
"^DD",9000010.12,9000010.12,801,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,801,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,801,21,0)
^.001^2^2^3150730^^^^
"^DD",9000010.12,9000010.12,801,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,801,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,801,"AUDIT")
y
"^DD",9000010.12,9000010.12,801,"DT")
3150730
"^DD",9000010.12,9000010.12,802,0)
DIAGNOSIS 2^*P80'a^ICD9(^80;2^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,802,.1)
Diagnosis 2
"^DD",9000010.12,9000010.12,802,3)
Enter the ICD Diagnosis related to the skin test performed.
"^DD",9000010.12,9000010.12,802,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,802,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,802,21,0)
^.001^2^2^3150729^^
"^DD",9000010.12,9000010.12,802,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,802,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,802,"AUDIT")
y
"^DD",9000010.12,9000010.12,802,"DT")
3150729
"^DD",9000010.12,9000010.12,803,0)
DIAGNOSIS 3^*P80'a^ICD9(^80;3^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,803,.1)
Diagnosis 3
"^DD",9000010.12,9000010.12,803,3)
Enter the ICD Diagnosis related to the skin test performed.
"^DD",9000010.12,9000010.12,803,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,803,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,803,21,0)
^^2^2^3150729^
"^DD",9000010.12,9000010.12,803,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,803,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,803,"AUDIT")
y
"^DD",9000010.12,9000010.12,803,"DT")
3150729
"^DD",9000010.12,9000010.12,804,0)
DIAGNOSIS 4^*P80'a^ICD9(^80;4^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,804,.1)
Diagnosis 4
"^DD",9000010.12,9000010.12,804,3)
Enter the ICD Diagnosis related to the skin test performed.
"^DD",9000010.12,9000010.12,804,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,804,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,804,21,0)
^^2^2^3150729^
"^DD",9000010.12,9000010.12,804,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,804,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,804,"AUDIT")
y
"^DD",9000010.12,9000010.12,804,"DT")
3150729
"^DD",9000010.12,9000010.12,805,0)
DIAGNOSIS 5^*P80'a^ICD9(^80;5^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,805,.1)
Diagnosis 5
"^DD",9000010.12,9000010.12,805,3)
Enter the ICD Diagnosis related to the skin test performed.
"^DD",9000010.12,9000010.12,805,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,805,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,805,21,0)
^^2^2^3150729^
"^DD",9000010.12,9000010.12,805,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,805,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,805,"AUDIT")
y
"^DD",9000010.12,9000010.12,805,"DT")
3150729
"^DD",9000010.12,9000010.12,806,0)
DIAGNOSIS 6^*P80'a^ICD9(^80;6^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,806,.1)
Diagnosis 6
"^DD",9000010.12,9000010.12,806,3)
Enter the ICD Diagnosis related to the skin test performed.
"^DD",9000010.12,9000010.12,806,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,806,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,806,21,0)
^^2^2^3150729^
"^DD",9000010.12,9000010.12,806,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,806,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,806,"AUDIT")
y
"^DD",9000010.12,9000010.12,806,"DT")
3150729
"^DD",9000010.12,9000010.12,807,0)
DIAGNOSIS 7^*P80'a^ICD9(^80;7^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,807,.1)
Diagnosis 7
"^DD",9000010.12,9000010.12,807,3)
Enter the ICD Diagnosis related to the skin test performed.
"^DD",9000010.12,9000010.12,807,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,807,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,807,21,0)
^^2^2^3150729^
"^DD",9000010.12,9000010.12,807,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,807,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,807,"AUDIT")
y
"^DD",9000010.12,9000010.12,807,"DT")
3150729
"^DD",9000010.12,9000010.12,808,0)
DIAGNOSIS 8^*P80'a^ICD9(^80;8^S DIC("S")="D ^AUPNSICD" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,808,.1)
Diagnosis 8
"^DD",9000010.12,9000010.12,808,3)
Enter the ICD Diagnosis related to the skin test performed.
"^DD",9000010.12,9000010.12,808,12)
Diagnosis cannot be an inactive code and it must be appropriate.
"^DD",9000010.12,9000010.12,808,12.1)
S DIC("S")="D ^AUPNSICD"
"^DD",9000010.12,9000010.12,808,21,0)
^^2^2^3150729^
"^DD",9000010.12,9000010.12,808,21,1,0)
This is the diagnosis from the ICD Diagnosis file associated with the 
"^DD",9000010.12,9000010.12,808,21,2,0)
skin test performed.
"^DD",9000010.12,9000010.12,808,"AUDIT")
y
"^DD",9000010.12,9000010.12,808,"DT")
3150729
"^DD",9000010.12,9000010.12,1201,0)
EVENT DATE AND TIME^DXa^^12;1^S %DT="ET" D ^%DT S X=Y K:Y<1!$$TIME^PXVUTL X
"^DD",9000010.12,9000010.12,1201,.1)
Placement Date and Time
"^DD",9000010.12,9000010.12,1201,1,0)
^.1^^-1
"^DD",9000010.12,9000010.12,1201,1,1,0)
^^TRIGGER^9000010.12^1211
"^DD",9000010.12,9000010.12,1201,1,1,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^AUPNVSK(D0,12)):^(12),1:"") S X=$P(Y(1),U,11),X=X S DIU=X K Y S X=DIV N %I,%H,% D NOW^%DTC S X=% X ^DD(9000010.12,1201,1,1,1.4)
"^DD",9000010.12,9000010.12,1201,1,1,1.4)
S DIH=$G(^AUPNVSK(DIV(0),12)),DIV=X S $P(^(12),U,11)=DIV,DIH=9000010.12,DIG=1211 D ^DICR
"^DD",9000010.12,9000010.12,1201,1,1,2)
Q
"^DD",9000010.12,9000010.12,1201,1,1,"%D",0)
^^3^3^3141216^
"^DD",9000010.12,9000010.12,1201,1,1,"%D",1,0)
The SKIN TEST PLACEMENT RECORDED field (#1211) will be triggered 
"^DD",9000010.12,9000010.12,1201,1,1,"%D",2,0)
whenever the EVENT DATE AND TIME field (#1201) is entered or updated.
"^DD",9000010.12,9000010.12,1201,1,1,"%D",3,0)
The triggered value will be NOW.
"^DD",9000010.12,9000010.12,1201,1,1,"CREATE VALUE")
NOW
"^DD",9000010.12,9000010.12,1201,1,1,"DELETE VALUE")
NO EFFECT
"^DD",9000010.12,9000010.12,1201,1,1,"DT")
3141216
"^DD",9000010.12,9000010.12,1201,1,1,"FIELD")
SKIN TEST PLACEMENT RECORDED
"^DD",9000010.12,9000010.12,1201,3)
Enter the date and (optional) time the skin test was placed.
"^DD",9000010.12,9000010.12,1201,21,0)
^^9^9^3150820^
"^DD",9000010.12,9000010.12,1201,21,1,0)
This is the date and time the skin test was placed. This date and time 
"^DD",9000010.12,9000010.12,1201,21,2,0)
may be different from the visit date and time. For example, for clinic
"^DD",9000010.12,9000010.12,1201,21,3,0)
appointment visits, the visit date and time is the date and time of the
"^DD",9000010.12,9000010.12,1201,21,4,0)
appointment, not the time the provider performed the clinical event.
"^DD",9000010.12,9000010.12,1201,21,5,0)
 
"^DD",9000010.12,9000010.12,1201,21,6,0)
The date may be an imprecise date such as for an historical skin test.
"^DD",9000010.12,9000010.12,1201,21,7,0)
 
"^DD",9000010.12,9000010.12,1201,21,8,0)
Date and time may be within 30 days before or after the visit date, 
"^DD",9000010.12,9000010.12,1201,21,9,0)
with the restriction the date cannot be a future date.
"^DD",9000010.12,9000010.12,1201,23,0)
^^13^13^3150820^
"^DD",9000010.12,9000010.12,1201,23,1,0)
The PCE User Interface, which allows manual entry of data, will be the 
"^DD",9000010.12,9000010.12,1201,23,2,0)
primary source of the event date and time. The event date prompt
"^DD",9000010.12,9000010.12,1201,23,3,0)
defaults to the visit date and the time is entered to reflect the actual
"^DD",9000010.12,9000010.12,1201,23,4,0)
time the skin test was done. The event date does not have to be the
"^DD",9000010.12,9000010.12,1201,23,5,0)
visit date, but it must be within 30 days before or after the visit, and
"^DD",9000010.12,9000010.12,1201,23,6,0)
not be a future date.
"^DD",9000010.12,9000010.12,1201,23,7,0)
 
"^DD",9000010.12,9000010.12,1201,23,8,0)
If a user wants to enter an historical skin test, the user should use 
"^DD",9000010.12,9000010.12,1201,23,9,0)
the Historical Encounter entry action to document the historical skin
"^DD",9000010.12,9000010.12,1201,23,10,0)
test. Historical entries will not be eligible for workload credit.
"^DD",9000010.12,9000010.12,1201,23,11,0)
 
"^DD",9000010.12,9000010.12,1201,23,12,0)
PCE data sources for automatic (scanning) data capture will be blank 
"^DD",9000010.12,9000010.12,1201,23,13,0)
unless the event date and time are passed to PCE for filing.
"^DD",9000010.12,9000010.12,1201,"AUDIT")
y
"^DD",9000010.12,9000010.12,1201,"DT")
3150820
"^DD",9000010.12,9000010.12,1202,0)
ORDERING PROVIDER^P200'a^VA(200,^12;2^Q
"^DD",9000010.12,9000010.12,1202,3)
Enter the provider who ordered this skin test.
"^DD",9000010.12,9000010.12,1202,21,0)
^^1^1^2960513^
"^DD",9000010.12,9000010.12,1202,21,1,0)
This field can be used to document the provider who ordered the skin test.
"^DD",9000010.12,9000010.12,1202,"AUDIT")
y
"^DD",9000010.12,9000010.12,1202,"DT")
3150213
"^DD",9000010.12,9000010.12,1204,0)
ENCOUNTER PROVIDER^P200'a^VA(200,^12;4^Q
"^DD",9000010.12,9000010.12,1204,.1)
Provider Placing Skin Test
"^DD",9000010.12,9000010.12,1204,3)
Enter the provider who placed the skin test.
"^DD",9000010.12,9000010.12,1204,21,0)
^^1^1^3141216^
"^DD",9000010.12,9000010.12,1204,21,1,0)
This is the provider who placed the skin test.
"^DD",9000010.12,9000010.12,1204,23,0)
^.001^1^1^3141216^^^
"^DD",9000010.12,9000010.12,1204,23,1,0)
This person can be any person in the new person file.
"^DD",9000010.12,9000010.12,1204,"AUDIT")
y
"^DD",9000010.12,9000010.12,1204,"DT")
3150213
"^DD",9000010.12,9000010.12,1211,0)
SKIN TEST PLACEMENT RECORDED^Da^^12;11^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.12,9000010.12,1211,.1)
Date/Time Skin Test Placement Recorded
"^DD",9000010.12,9000010.12,1211,3)
Enter the date and time of documentation of the placement of the skin test.
"^DD",9000010.12,9000010.12,1211,5,1,0)
9000010.12^1201^1
"^DD",9000010.12,9000010.12,1211,21,0)
^^3^3^3141217^
"^DD",9000010.12,9000010.12,1211,21,1,0)
This timestamp field is the date and time of documentation of placement 
"^DD",9000010.12,9000010.12,1211,21,2,0)
of the skin test. This field is set automatically when the EVENT DATE
"^DD",9000010.12,9000010.12,1211,21,3,0)
AND TIME is entered.
"^DD",9000010.12,9000010.12,1211,"AUDIT")
y
"^DD",9000010.12,9000010.12,1211,"DT")
3150213
"^DD",9000010.12,9000010.12,1212,0)
ANATOMIC LOCATION OF PLACEMENT^*P920.3'a^PXV(920.3,^12;12^S DIC("S")="I '$$SCREEN^XTID(920.3,,Y_"","")" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
"^DD",9000010.12,9000010.12,1212,.1)
Anatomic Location of Skin Test Placement
"^DD",9000010.12,9000010.12,1212,3)
Select the anatomic location of skin test placement.
"^DD",9000010.12,9000010.12,1212,12)
Only active IMM ADMINISTRATION SITE (BODY) entries may be selected.
"^DD",9000010.12,9000010.12,1212,12.1)
S DIC("S")="I '$$SCREEN^XTID(920.3,,Y_"","")"
"^DD",9000010.12,9000010.12,1212,21,0)
^.001^1^1^3141216^^
"^DD",9000010.12,9000010.12,1212,21,1,0)
This is the area of the patient's body where the skin test was placed.
"^DD",9000010.12,9000010.12,1212,23,0)
^^3^3^3141216^
"^DD",9000010.12,9000010.12,1212,23,1,0)
This is the area of the patient's body where the skin test was placed. 
"^DD",9000010.12,9000010.12,1212,23,2,0)
It is selected from a list of entries in the IMM ADMINISTRATION SITE
"^DD",9000010.12,9000010.12,1212,23,3,0)
(BODY) file (#920.3).
"^DD",9000010.12,9000010.12,1212,"AUDIT")
y
"^DD",9000010.12,9000010.12,1212,"DT")
3150226
"^DD",9000010.12,9000010.12,1214,0)
HOURS READ POST-PLACEMENT^NJ3,0Ia^^12;14^K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X
"^DD",9000010.12,9000010.12,1214,.1)
Hours Between Placement and Reading
"^DD",9000010.12,9000010.12,1214,3)
Type a number between 0 and 100, 0 decimal digits.
"^DD",9000010.12,9000010.12,1214,21,0)
^.001^2^2^3150205^^^
"^DD",9000010.12,9000010.12,1214,21,1,0)
This is the number of hours between the placement of the skin test and 
"^DD",9000010.12,9000010.12,1214,21,2,0)
the reading of the skin test.
"^DD",9000010.12,9000010.12,1214,23,0)
^.001^2^2^3150205^^
"^DD",9000010.12,9000010.12,1214,23,1,0)
This field is set by cross references on the EVENT DATE AND TIME field 
"^DD",9000010.12,9000010.12,1214,23,2,0)
(#1201) and the DATE READ field (#.06).
"^DD",9000010.12,9000010.12,1214,"AUDIT")
y
"^DD",9000010.12,9000010.12,1214,"DT")
3150818
"^DD",9000010.12,9000010.12,1220,0)
SKIN TEST READING RECORDED^Da^^12;20^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
"^DD",9000010.12,9000010.12,1220,.1)
Date/Time Skin Test Reading Recorded
"^DD",9000010.12,9000010.12,1220,3)
Enter the date and time of documentation of the reading of the skin test.
"^DD",9000010.12,9000010.12,1220,5,1,0)
9000010.12^.06^1
"^DD",9000010.12,9000010.12,1220,21,0)
^.001^3^3^3150728^^
"^DD",9000010.12,9000010.12,1220,21,1,0)
This timestamp field is the date and time of documentation of reading 
"^DD",9000010.12,9000010.12,1220,21,2,0)
of the skin test. This field is set automatically when the DATE READ is 
"^DD",9000010.12,9000010.12,1220,21,3,0)
entered.
"^DD",9000010.12,9000010.12,1220,"AUDIT")
y
"^DD",9000010.12,9000010.12,1220,"DT")
3150728
"^DD",9000010.12,9000010.12,1301,0)
READING COMMENTS^Fa^^13;1^K:$L(X)>245!($L(X)<1) X
"^DD",9000010.12,9000010.12,1301,.1)
Reading Comments
"^DD",9000010.12,9000010.12,1301,3)
Enter a reading comment 1-245 characters in length.
"^DD",9000010.12,9000010.12,1301,21,0)
^^2^2^3141217^
"^DD",9000010.12,9000010.12,1301,21,1,0)
This is a comment related to the reading of the patient's skin test. 
"^DD",9000010.12,9000010.12,1301,21,2,0)
The provider may enter this manually via the PCE User Interface.
"^DD",9000010.12,9000010.12,1301,"AUDIT")
y
"^DD",9000010.12,9000010.12,1301,"DT")
3150213
"^DD",9000010.12,9000010.12,80101,0)
EDITED FLAG^Sa^1:EDITED;^801;1^Q
"^DD",9000010.12,9000010.12,80101,3)
Answer is automatically entered by PCE filing logic.
"^DD",9000010.12,9000010.12,80101,21,0)
^^2^2^2950831^
"^DD",9000010.12,9000010.12,80101,21,1,0)
This field is automatically set to 1 if PCE detects that any original skin test
"^DD",9000010.12,9000010.12,80101,21,2,0)
data is being edited.
"^DD",9000010.12,9000010.12,80101,23,0)
^^2^2^2950831^
"^DD",9000010.12,9000010.12,80101,23,1,0)
PCE filing logic automatically compares the before and after pictures of the
"^DD",9000010.12,9000010.12,80101,23,2,0)
record to determine if the edited flag should be set to "1".
"^DD",9000010.12,9000010.12,80101,"AUDIT")
y
"^DD",9000010.12,9000010.12,80101,"DT")
3150213
"^DD",9000010.12,9000010.12,80102,0)
AUDIT TRAIL^Fa^^801;2^K:$L(X)>85!($L(X)<2) X
"^DD",9000010.12,9000010.12,80102,3)
Answer must be 2 to 85 characters.
"^DD",9000010.12,9000010.12,80102,21,0)
^^4^4^3150813^
"^DD",9000010.12,9000010.12,80102,21,1,0)
This field is populated automatically be the PCE filing logic. The 
"^DD",9000010.12,9000010.12,80102,21,2,0)
format of the field is as follows:  Pointer to PCE data source
"^DD",9000010.12,9000010.12,80102,21,3,0)
file_"-"_A for Add or E for Edit_" "_DUZ of the person who entered the
"^DD",9000010.12,9000010.12,80102,21,4,0)
data_";"...
"^DD",9000010.12,9000010.12,80102,23,0)
^.001^14^14^3150813^^^^
"^DD",9000010.12,9000010.12,80102,23,1,0)
The PCE filing logic requires a pointer to the PCE data source file.  If this
"^DD",9000010.12,9000010.12,80102,23,2,0)
is not passed, then PCE filing logic will not process the data.
"^DD",9000010.12,9000010.12,80102,23,3,0)
 
"^DD",9000010.12,9000010.12,80102,23,4,0)
If the record is a new record, then an "A" is used to specify the source that
"^DD",9000010.12,9000010.12,80102,23,5,0)
added the data.  If the record existed previously, PCE filing logic compares
"^DD",9000010.12,9000010.12,80102,23,6,0)
the old and new records of information.  An "E" will be automatically used if
"^DD",9000010.12,9000010.12,80102,23,7,0)
the filing logic finds the data has been edited.  If "E" is used, then the
"^DD",9000010.12,9000010.12,80102,23,8,0)
Edited Flag field is automatically set to 1.
"^DD",9000010.12,9000010.12,80102,23,9,0)
 
"^DD",9000010.12,9000010.12,80102,23,10,0)
The DUZ is stored in its internal format to represent the user who performed
"^DD",9000010.12,9000010.12,80102,23,11,0)
the adding or editing of data for this record.
"^DD",9000010.12,9000010.12,80102,23,12,0)
 
"^DD",9000010.12,9000010.12,80102,23,13,0)
Iterations of editing will be concatenated to the previous data source value,
"^DD",9000010.12,9000010.12,80102,23,14,0)
up to 85 characters.
"^DD",9000010.12,9000010.12,80102,"AUDIT")
y
"^DD",9000010.12,9000010.12,80102,"DT")
3150213
"^DD",9000010.12,9000010.12,81101,0)
PLACEMENT COMMENTS^Fa^^811;1^K:$L(X)>245!($L(X)<1) X
"^DD",9000010.12,9000010.12,81101,.1)
Placement Comments
"^DD",9000010.12,9000010.12,81101,3)
Enter a placement comment 1-245 characters in length.
"^DD",9000010.12,9000010.12,81101,21,0)
^^2^2^3141216^
"^DD",9000010.12,9000010.12,81101,21,1,0)
This is a comment related to the placement of the patient's skin test.
"^DD",9000010.12,9000010.12,81101,21,2,0)
The provider may enter this manually via the PCE User Interface.
"^DD",9000010.12,9000010.12,81101,"AUDIT")
y
"^DD",9000010.12,9000010.12,81101,"DT")
3150213
"^DD",9000010.12,9000010.12,81201,0)
VERIFIED^SIa^1:ELECTRONICALLY SIGNED;2:VERIFIED BY PACKAGE;^812;1^Q
"^DD",9000010.12,9000010.12,81201,3)
This is automatically entered by the software and is uneditable.
"^DD",9000010.12,9000010.12,81201,21,0)
^.001^2^2^3150213^^
"^DD",9000010.12,9000010.12,81201,21,1,0)
This is used to note how the event was verified and is automatically
"^DD",9000010.12,9000010.12,81201,21,2,0)
entered by the software.
"^DD",9000010.12,9000010.12,81201,23,0)
^.001^1^1^3150213^^
"^DD",9000010.12,9000010.12,81201,23,1,0)
This is automatically entered by the software and is uneditable for users.
"^DD",9000010.12,9000010.12,81201,"AUDIT")
y
"^DD",9000010.12,9000010.12,81201,"DT")
3150213
"^DD",9000010.12,9000010.12,81202,0)
PACKAGE^P9.4'Ia^DIC(9.4,^812;2^Q
"^DD",9000010.12,9000010.12,81202,.1)
Package
"^DD",9000010.12,9000010.12,81202,3)
Enter the VistA package from which this record originated.
"^DD",9000010.12,9000010.12,81202,21,0)
^^4^4^3150813^
"^DD",9000010.12,9000010.12,81202,21,1,0)
This is the VistA package from which this skin test record 
"^DD",9000010.12,9000010.12,81202,21,2,0)
originated through PCE.
"^DD",9000010.12,9000010.12,81202,21,3,0)
 
"^DD",9000010.12,9000010.12,81202,21,4,0)
This is automatically entered by the software and uneditable by users.
"^DD",9000010.12,9000010.12,81202,"AUDIT")
y
"^DD",9000010.12,9000010.12,81202,"DT")
3150813
"^DD",9000010.12,9000010.12,81203,0)
DATA SOURCE^P839.7'Ia^PX(839.7,^812;3^Q
"^DD",9000010.12,9000010.12,81203,3)
Select the data source for this skin test entry through PCE.
"^DD",9000010.12,9000010.12,81203,21,0)
^^2^2^3150213^
"^DD",9000010.12,9000010.12,81203,21,1,0)
This is the data source for this skin test, automatically entered 
"^DD",9000010.12,9000010.12,81203,21,2,0)
through the PCS software and uneditable by users.
"^DD",9000010.12,9000010.12,81203,"AUDIT")
y
"^DD",9000010.12,9000010.12,81203,"DT")
3150213
"^DD",9000010.12,9000010.123,0)
CODING SYSTEM SUB-FIELD^^.02^2
"^DD",9000010.12,9000010.123,0,"DT")
3150211
"^DD",9000010.12,9000010.123,0,"IX","B",9000010.123,.01)

"^DD",9000010.12,9000010.123,0,"NM","CODING SYSTEM")

"^DD",9000010.12,9000010.123,0,"UP")
9000010.12
"^DD",9000010.12,9000010.123,.01,0)
CODING SYSTEM^MFa^^0;1^K:$L(X)>7!($L(X)<3) X
"^DD",9000010.12,9000010.123,.01,.1)
Coding System
"^DD",9000010.12,9000010.123,.01,1,0)
^.1
"^DD",9000010.12,9000010.123,.01,1,1,0)
9000010.123^B
"^DD",9000010.12,9000010.123,.01,1,1,1)
S ^AUPNVSK(DA(1),3,"B",$E(X,1,30),DA)=""
"^DD",9000010.12,9000010.123,.01,1,1,2)
K ^AUPNVSK(DA(1),3,"B",$E(X,1,30),DA)
"^DD",9000010.12,9000010.123,.01,3)
Answer must be 3-7 characters in length.
"^DD",9000010.12,9000010.123,.01,21,0)
^.001^2^2^3150213^^^
"^DD",9000010.12,9000010.123,.01,21,1,0)
This field indicates the coding system associated with the codes 
"^DD",9000010.12,9000010.123,.01,21,2,0)
identifying this skin test. 
"^DD",9000010.12,9000010.123,.01,"AUDIT")
y
"^DD",9000010.12,9000010.123,.01,"DT")
3150211
"^DD",9000010.12,9000010.123,.02,0)
CODE^9000010.1231^^1;0
"^DD",9000010.12,9000010.123,.02,21,0)
^.001^2^2^3150213^^
"^DD",9000010.12,9000010.123,.02,21,1,0)
This multiple stores the code(s) representing this skin test within 
"^DD",9000010.12,9000010.123,.02,21,2,0)
this coding system.
"^DD",9000010.12,9000010.1231,0)
CODE SUB-FIELD^^.01^1
"^DD",9000010.12,9000010.1231,0,"DT")
3150211
"^DD",9000010.12,9000010.1231,0,"IX","B",9000010.1231,.01)

"^DD",9000010.12,9000010.1231,0,"NM","CODE")

"^DD",9000010.12,9000010.1231,0,"UP")
9000010.123
"^DD",9000010.12,9000010.1231,.01,0)
CODE^Fa^^0;1^K:$L(X)>30!($L(X)<1) X
"^DD",9000010.12,9000010.1231,.01,.1)
Code
"^DD",9000010.12,9000010.1231,.01,1,0)
^.1
"^DD",9000010.12,9000010.1231,.01,1,1,0)
9000010.1231^B
"^DD",9000010.12,9000010.1231,.01,1,1,1)
S ^AUPNVSK(DA(2),3,DA(1),1,"B",$E(X,1,30),DA)=""
"^DD",9000010.12,9000010.1231,.01,1,1,2)
K ^AUPNVSK(DA(2),3,DA(1),1,"B",$E(X,1,30),DA)
"^DD",9000010.12,9000010.1231,.01,3)
Answer must be 1-30 characters in length.
"^DD",9000010.12,9000010.1231,.01,21,0)
^^1^1^3150211^
"^DD",9000010.12,9000010.1231,.01,21,1,0)
This code represents this skin test within this coding system.
"^DD",9000010.12,9000010.1231,.01,"AUDIT")
y
"^DD",9000010.12,9000010.1231,.01,"DT")
3150211
"^DD",9999999.41,9999999.41,0)
FIELD^^.18^17
"^DD",9999999.41,9999999.41,0,"DDA")
N
"^DD",9999999.41,9999999.41,0,"DT")
3150720
"^DD",9999999.41,9999999.41,0,"ID",.02)
S %I=Y,Y=$S('$D(^(0)):"",$D(^AUTTIMAN(+$P(^(0),U,2),0))#2:$P(^(0),U,1),1:""),C=$P(^DD(9999999.04,.01,0),U,2) D Y^DIQ:Y]"" W "   ",Y,@("$E("_DIC_"%I,0),0)") S Y=%I K %I
"^DD",9999999.41,9999999.41,0,"ID",.04)
S %I=Y,Y=$S('$D(^(0)):"",$D(^AUTTIMM(+$P(^(0),U,4),0))#2:$P(^(0),U,1),1:""),C=$P(^DD(9999999.14,.01,0),U,2) D Y^DIQ:Y]"" W "   ",Y,@("$E("_DIC_"%I,0),0)") S Y=%I K %I
"^DD",9999999.41,9999999.41,0,"ID",.09)
W "   ",$$FMTE^DILIBF($P(^(0),U,9),6)
"^DD",9999999.41,9999999.41,0,"ID",.12)
D EN^DDIOL("   "_+$P(^(0),U,12)_" DOSES UNUSED")
"^DD",9999999.41,9999999.41,0,"IX","AE",9999999.41,.09)

"^DD",9999999.41,9999999.41,0,"IX","B",9999999.41,.01)

"^DD",9999999.41,9999999.41,0,"IX","C",9999999.41,.04)

"^DD",9999999.41,9999999.41,0,"NM","IMMUNIZATION LOT")

"^DD",9999999.41,9999999.41,0,"PT",9000010.11,.05)

"^DD",9999999.41,9999999.41,0,"PT",9000010.11,1207)

"^DD",9999999.41,9999999.41,0,"PT",9999999.14,.04)

"^DD",9999999.41,9999999.41,.01,0)
LOT NUMBER^FXa^^0;1^K:$L(X)>25!($L(X)<3)!'(X'?1P.E) X I $D(X),$G(DA) D INUSE^PXVXR Q
"^DD",9999999.41,9999999.41,.01,.1)
Lot Number
"^DD",9999999.41,9999999.41,.01,1,0)
^.1^^-1
"^DD",9999999.41,9999999.41,.01,1,1,0)
9999999.41^B
"^DD",9999999.41,9999999.41,.01,1,1,1)
S ^AUTTIML("B",$E(X,1,30),DA)=""
"^DD",9999999.41,9999999.41,.01,1,1,2)
K ^AUTTIML("B",$E(X,1,30),DA)
"^DD",9999999.41,9999999.41,.01,3)
Answer must be 3-25 characters in length.
"^DD",9999999.41,9999999.41,.01,21,0)
^.001^1^1^3140515^^
"^DD",9999999.41,9999999.41,.01,21,1,0)
This is the lot number of a manufacturer's immunization/vaccine product.
"^DD",9999999.41,9999999.41,.01,23,0)
^.001^4^4^3140515^^
"^DD",9999999.41,9999999.41,.01,23,1,0)
A manufacturer's lot number for an immunization, 3-25 characters.
"^DD",9999999.41,9999999.41,.01,23,2,0)
In the Department of Veterans Affairs version of this file, more than
"^DD",9999999.41,9999999.41,.01,23,3,0)
one entry may have the same LOT NUMBER, but entries must have a unique
"^DD",9999999.41,9999999.41,.01,23,4,0)
combination of LOT NUMBER and MANUFACTURER.
"^DD",9999999.41,9999999.41,.01,"AUDIT")
y
"^DD",9999999.41,9999999.41,.01,"DEL",1,0)
I $D(^AUPNVIMM("LN",DA)) D EN^DDIOL("This lot number is already in use. Deletion is not allowed!  ",,"!!,?2")
"^DD",9999999.41,9999999.41,.01,"DT")
3150817
"^DD",9999999.41,9999999.41,.02,0)
MANUFACTURER^R*P9999999.04'Xa^AUTTIMAN(^0;2^S DIC("S")="I '$P(^AUTTIMAN(Y,0),U,3)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X I $D(X),$G(DA) D COMB1^PXVXR Q
"^DD",9999999.41,9999999.41,.02,.1)
Manufacturer
"^DD",9999999.41,9999999.41,.02,1,0)
^.1^^0
"^DD",9999999.41,9999999.41,.02,3)
Select the manufacturer of this lot number.
"^DD",9999999.41,9999999.41,.02,12)
You can only select a manufacturer with a STATUS of ACTIVE.
"^DD",9999999.41,9999999.41,.02,12.1)
S DIC("S")="I '$P(^AUTTIMAN(Y,0),U,3)"
"^DD",9999999.41,9999999.41,.02,21,0)
^.001^2^2^3140515^^^^
"^DD",9999999.41,9999999.41,.02,21,1,0)
This is the manufacturer using this lot number.  You will only be able to
"^DD",9999999.41,9999999.41,.02,21,2,0)
select manufacturers with a STATUS of ACTIVE.
"^DD",9999999.41,9999999.41,.02,23,0)
^.001^3^3^3140515^^^^
"^DD",9999999.41,9999999.41,.02,23,1,0)
This field is a pointer to the IMM MANFACTURER file (9999999.04).
"^DD",9999999.41,9999999.41,.02,23,2,0)
The field is screened so that only manufacturers with status of active
"^DD",9999999.41,9999999.41,.02,23,3,0)
can be seen in the lookup.
"^DD",9999999.41,9999999.41,.02,"AUDIT")
y
"^DD",9999999.41,9999999.41,.02,"DT")
3150817
"^DD",9999999.41,9999999.41,.03,0)
STATUS^Sa^2:EXPIRED;1:INACTIVE;0:ACTIVE;^0;3^Q
"^DD",9999999.41,9999999.41,.03,.1)
Status
"^DD",9999999.41,9999999.41,.03,3)
Enter '1' or 'INACTIVE' to designate this lot as inactive.
"^DD",9999999.41,9999999.41,.03,21,0)
^.001^3^3^3140515^^^^
"^DD",9999999.41,9999999.41,.03,21,1,0)
This is the status of this lot number, used to determine if this lot is
"^DD",9999999.41,9999999.41,.03,21,2,0)
usable.  As long this field is blank or has a value of '0', it will be
"^DD",9999999.41,9999999.41,.03,21,3,0)
seen as ACTIVE.  If a '1' is entered, it will be seen as INACTIVE.
"^DD",9999999.41,9999999.41,.03,23,0)
^.001^2^2^3140515^^^^
"^DD",9999999.41,9999999.41,.03,23,1,0)
This field is seen as ACTIVE as long it is blank or a '0', which may
"^DD",9999999.41,9999999.41,.03,23,2,0)
be the opposite of what you are used to seeing.
"^DD",9999999.41,9999999.41,.03,"AUDIT")
y
"^DD",9999999.41,9999999.41,.03,"DT")
3150720
"^DD",9999999.41,9999999.41,.04,0)
VACCINE^R*P9999999.14'Xa^AUTTIMM(^0;4^S DIC("S")="I '$P(^(0),U,7)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X I $D(X),$G(DA) D COMB2^PXVXR Q
"^DD",9999999.41,9999999.41,.04,.1)
Vaccine
"^DD",9999999.41,9999999.41,.04,1,0)
^.1^^-1
"^DD",9999999.41,9999999.41,.04,1,1,0)
9999999.41^C
"^DD",9999999.41,9999999.41,.04,1,1,1)
S ^AUTTIML("C",$E(X,1,30),DA)=""
"^DD",9999999.41,9999999.41,.04,1,1,2)
K ^AUTTIML("C",$E(X,1,30),DA)
"^DD",9999999.41,9999999.41,.04,1,1,3)
This cross reference is used for lookups.
"^DD",9999999.41,9999999.41,.04,1,1,"%D",0)
^^2^2^3150526^
"^DD",9999999.41,9999999.41,.04,1,1,"%D",1,0)
This cross reference allows lot numbers to be selected by their
"^DD",9999999.41,9999999.41,.04,1,1,"%D",2,0)
associated IMMUNIZATION (VACCINE).
"^DD",9999999.41,9999999.41,.04,1,1,"DT")
3140527
"^DD",9999999.41,9999999.41,.04,3)
Enter a vaccine that uses this lot number and manufacturer.
"^DD",9999999.41,9999999.41,.04,12)
Vaccine must be active.
"^DD",9999999.41,9999999.41,.04,12.1)
S DIC("S")="I '$P(^(0),U,7)"
"^DD",9999999.41,9999999.41,.04,21,0)
^.001^2^2^3140828^^^^
"^DD",9999999.41,9999999.41,.04,21,1,0)
This is a VACCINE that is labeled with this lot number and produced by
"^DD",9999999.41,9999999.41,.04,21,2,0)
lot's manufacturer.  The vaccine must designated as active.
"^DD",9999999.41,9999999.41,.04,"AUDIT")
y
"^DD",9999999.41,9999999.41,.04,"DT")
3150817
"^DD",9999999.41,9999999.41,.05,0)
VACCINE #2^P9999999.14'a^AUTTIMM(^0;5^Q
"^DD",9999999.41,9999999.41,.05,.1)
Vaccine #2
"^DD",9999999.41,9999999.41,.05,3)
Enter a vaccine that has this lot number and manufacturer.
"^DD",9999999.41,9999999.41,.05,21,0)
^^2^2^3140828^
"^DD",9999999.41,9999999.41,.05,21,1,0)
This is a VACCINE that is labeled with this lot number and produced by
"^DD",9999999.41,9999999.41,.05,21,2,0)
lot's manufacturer.
"^DD",9999999.41,9999999.41,.05,23,0)
^.001^3^3^3140828^^
"^DD",9999999.41,9999999.41,.05,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.05,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.05,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.05,"AUDIT")
y
"^DD",9999999.41,9999999.41,.05,"DT")
3150720
"^DD",9999999.41,9999999.41,.06,0)
VACCINE #3^P9999999.14'a^AUTTIMM(^0;6^Q
"^DD",9999999.41,9999999.41,.06,.1)
Vaccine #3
"^DD",9999999.41,9999999.41,.06,3)
Enter a vaccine that has this lot number and manufacturer.
"^DD",9999999.41,9999999.41,.06,21,0)
^^2^2^3140828^
"^DD",9999999.41,9999999.41,.06,21,1,0)
This is a VACCINE that is labeled with this lot number and produced by
"^DD",9999999.41,9999999.41,.06,21,2,0)
lot's manufacturer.
"^DD",9999999.41,9999999.41,.06,23,0)
^^3^3^3140625^
"^DD",9999999.41,9999999.41,.06,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.06,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.06,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.06,"AUDIT")
y
"^DD",9999999.41,9999999.41,.06,"DT")
3150720
"^DD",9999999.41,9999999.41,.07,0)
VACCINE #4^P9999999.14'a^AUTTIMM(^0;7^Q
"^DD",9999999.41,9999999.41,.07,.1)
Vaccine #4
"^DD",9999999.41,9999999.41,.07,3)
Enter a vaccine that has this lot number and manufacturer.
"^DD",9999999.41,9999999.41,.07,21,0)
^^2^2^3140828^
"^DD",9999999.41,9999999.41,.07,21,1,0)
This is a VACCINE that is labeled with this lot number and produced by
"^DD",9999999.41,9999999.41,.07,21,2,0)
lot's manufacturer.
"^DD",9999999.41,9999999.41,.07,23,0)
^^3^3^3140625^
"^DD",9999999.41,9999999.41,.07,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.07,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.07,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.07,"AUDIT")
y
"^DD",9999999.41,9999999.41,.07,"DT")
3150720
"^DD",9999999.41,9999999.41,.08,0)
VACCINE #5^P9999999.14'a^AUTTIMM(^0;8^Q
"^DD",9999999.41,9999999.41,.08,.1)
Vaccine #5
"^DD",9999999.41,9999999.41,.08,3)
Enter vaccine that has this lot number and manufacturer.
"^DD",9999999.41,9999999.41,.08,21,0)
^^2^2^3140828^
"^DD",9999999.41,9999999.41,.08,21,1,0)
This is a VACCINE that is labeled with this lot number and produced by
"^DD",9999999.41,9999999.41,.08,21,2,0)
lot's manufacturer.
"^DD",9999999.41,9999999.41,.08,23,0)
^^3^3^3140625^
"^DD",9999999.41,9999999.41,.08,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.08,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.08,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.08,"AUDIT")
y
"^DD",9999999.41,9999999.41,.08,"DT")
3150720
"^DD",9999999.41,9999999.41,.09,0)
EXPIRATION DATE^RDXa^^0;9^S %DT="EX" D ^%DT S X=Y K:Y<1 X I $D(X) D EXP^PXVXR Q
"^DD",9999999.41,9999999.41,.09,.1)
Expiration Date
"^DD",9999999.41,9999999.41,.09,1,0)
^.1
"^DD",9999999.41,9999999.41,.09,1,1,0)
9999999.41^AE
"^DD",9999999.41,9999999.41,.09,1,1,1)
S ^AUTTIML("AE",$E(X,1,30),DA)=""
"^DD",9999999.41,9999999.41,.09,1,1,2)
K ^AUTTIML("AE",$E(X,1,30),DA)
"^DD",9999999.41,9999999.41,.09,1,1,"%D",0)
^.101^2^2^3140513^^
"^DD",9999999.41,9999999.41,.09,1,1,"%D",1,0)
Used by a task set to run nightly to change the status of lot numbers
"^DD",9999999.41,9999999.41,.09,1,1,"%D",2,0)
that have expired.
"^DD",9999999.41,9999999.41,.09,1,1,"DT")
3140507
"^DD",9999999.41,9999999.41,.09,3)
Enter the expiration date for this lot number.
"^DD",9999999.41,9999999.41,.09,21,0)
^.001^2^2^3150423^^^^
"^DD",9999999.41,9999999.41,.09,21,1,0)
This is the date that the immunization represented by this lot number is
"^DD",9999999.41,9999999.41,.09,21,2,0)
due to expire, as determined by the manufacturer.
"^DD",9999999.41,9999999.41,.09,23,0)
^.001^4^4^3150423^^^
"^DD",9999999.41,9999999.41,.09,23,1,0)
This field is used to determine if the immunization represented by this 
"^DD",9999999.41,9999999.41,.09,23,2,0)
lot number has expired.  This field is checked nightly by a background
"^DD",9999999.41,9999999.41,.09,23,3,0)
task.  If the EXPIRATION DATE is equal to that day's date (or in the past),
"^DD",9999999.41,9999999.41,.09,23,4,0)
the STATUS field is set to "EXPIRED".
"^DD",9999999.41,9999999.41,.09,"AUDIT")
y
"^DD",9999999.41,9999999.41,.09,"DT")
3150720
"^DD",9999999.41,9999999.41,.11,0)
STARTING COUNT^NJ5,0a^^0;11^K:+X'=X!(X>99999)!(X<1)!(X?.E1"."1N.N) X
"^DD",9999999.41,9999999.41,.11,.1)
Starting Count
"^DD",9999999.41,9999999.41,.11,1,0)
^.1
"^DD",9999999.41,9999999.41,.11,1,1,0)
^^TRIGGER^9999999.41^.12
"^DD",9999999.41,9999999.41,.11,1,1,1)
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S Y(1)=$S($D(^AUTTIML(D0,0)):^(0),1:"") S X=$P(Y(1),U,12)="" I X S X=DIV S Y(1)=$S($D(^AUTTIML(D0,0)):^(0),1:"") S X=$P(Y(1),U,12),X=X S DIU=X K Y S X=DIV S X=DIV X ^DD(9999999.41,.11,1,1,1.4)
"^DD",9999999.41,9999999.41,.11,1,1,1.4)
S DIH=$G(^AUTTIML(DIV(0),0)),DIV=X S $P(^(0),U,12)=DIV,DIH=9999999.41,DIG=.12 D ^DICR
"^DD",9999999.41,9999999.41,.11,1,1,2)
Q
"^DD",9999999.41,9999999.41,.11,1,1,"%D",0)
^^2^2^3140507^
"^DD",9999999.41,9999999.41,.11,1,1,"%D",1,0)
When the STARTING COUNT is entered, DOSES UNUSED is checked.  If DOSES
"^DD",9999999.41,9999999.41,.11,1,1,"%D",2,0)
UNUSED is NULL, then it is set to the STARTING COUNT.
"^DD",9999999.41,9999999.41,.11,1,1,"CREATE CONDITION")
DOSES UNUSED=""
"^DD",9999999.41,9999999.41,.11,1,1,"CREATE VALUE")
STARTING COUNT
"^DD",9999999.41,9999999.41,.11,1,1,"DELETE VALUE")
NO EFFECT
"^DD",9999999.41,9999999.41,.11,1,1,"FIELD")
DOSES UNUSED
"^DD",9999999.41,9999999.41,.11,1,1,"NOREINDEX")
1
"^DD",9999999.41,9999999.41,.11,3)
Enter the initial number of doses for this lot.
"^DD",9999999.41,9999999.41,.11,21,0)
^.001^1^1^3140515^^^^
"^DD",9999999.41,9999999.41,.11,21,1,0)
This is the starting number of doses for this lot, from 1 to 99,999.
"^DD",9999999.41,9999999.41,.11,23,0)
^.001^3^3^3140515^^^
"^DD",9999999.41,9999999.41,.11,23,1,0)
This is the initial number of doses for this lot, which should be a
"^DD",9999999.41,9999999.41,.11,23,2,0)
number from 1 to 99999.  If the DOSES UNUSED field is empty, it is
"^DD",9999999.41,9999999.41,.11,23,3,0)
automatically set to the number entered here, via a trigger.
"^DD",9999999.41,9999999.41,.11,"AUDIT")
y
"^DD",9999999.41,9999999.41,.11,"DT")
3150720
"^DD",9999999.41,9999999.41,.12,0)
DOSES UNUSED^NJ5,0Xa^^0;12^K:$S(+X'=X:1,X>99999:1,X<0:1,X?.E1"."1N.N:1,$P(^AUTTIML(DA,0),"^",11)="":0,1:X>$P(^(0),"^",11)) X
"^DD",9999999.41,9999999.41,.12,.1)
Doses Unused
"^DD",9999999.41,9999999.41,.12,3)
Enter the number of doses remaining from this lot.
"^DD",9999999.41,9999999.41,.12,5,1,0)
9999999.41^.11^1
"^DD",9999999.41,9999999.41,.12,21,0)
^.001^2^2^3140507^^
"^DD",9999999.41,9999999.41,.12,21,1,0)
This is the number of remaining doses available for this lot.  The number
"^DD",9999999.41,9999999.41,.12,21,2,0)
cannot be greater than the original number of doses for this lot.
"^DD",9999999.41,9999999.41,.12,23,0)
^^3^3^3140507^
"^DD",9999999.41,9999999.41,.12,23,1,0)
This is the number doses for this lot that have not yet been used.  The 
"^DD",9999999.41,9999999.41,.12,23,2,0)
number entered is checked against the number entered for the STARTING COUNT
"^DD",9999999.41,9999999.41,.12,23,3,0)
field and cannot be greater.
"^DD",9999999.41,9999999.41,.12,"AUDIT")
y
"^DD",9999999.41,9999999.41,.12,"DT")
3150720
"^DD",9999999.41,9999999.41,.13,0)
VACCINE SOURCE^Sa^v:VFC;n:NON-VFC;o:Other State;i:IHS/Tribal;^0;13^Q
"^DD",9999999.41,9999999.41,.13,.1)
Vaccine Source
"^DD",9999999.41,9999999.41,.13,3)
Enter the source of this lot.
"^DD",9999999.41,9999999.41,.13,21,0)
^^1^1^3140828^
"^DD",9999999.41,9999999.41,.13,21,1,0)
This is the source of this lot, where it was obtained.
"^DD",9999999.41,9999999.41,.13,23,0)
^.001^3^3^3140828^^
"^DD",9999999.41,9999999.41,.13,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.13,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.13,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.13,"AUDIT")
y
"^DD",9999999.41,9999999.41,.13,"DT")
3150720
"^DD",9999999.41,9999999.41,.14,0)
HEALTH CARE FACILITY^P9999999.06'a^AUTTLOC(^0;14^Q
"^DD",9999999.41,9999999.41,.14,.1)
Health Care Facility
"^DD",9999999.41,9999999.41,.14,3)
Select the Health Care Facility (location) where this lot will be stored and used.
"^DD",9999999.41,9999999.41,.14,21,0)
^^1^1^3140828^
"^DD",9999999.41,9999999.41,.14,21,1,0)
This is the location (facility) where this lot will be stored and used.
"^DD",9999999.41,9999999.41,.14,23,0)
^.001^3^3^3140828^^
"^DD",9999999.41,9999999.41,.14,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.14,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.14,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.14,"AUDIT")
y
"^DD",9999999.41,9999999.41,.14,"DT")
3150720
"^DD",9999999.41,9999999.41,.15,0)
LOW SUPPLY ALERT^NJ5,0Xa^^0;15^K:+X'=X!(X>99998)!(X<0)!(X?.E1"."1N.N)!(X>$P(^AUTTIML(DA,0),U,11)) X
"^DD",9999999.41,9999999.41,.15,.1)
Low Supply Alert
"^DD",9999999.41,9999999.41,.15,3)
Enter the number of doses remaining that will trigger a Low Supply Alert for this lot, between 0 and 99,998.
"^DD",9999999.41,9999999.41,.15,21,0)
^.001^3^3^3150416^^^^
"^DD",9999999.41,9999999.41,.15,21,1,0)
This is a number that is used to determine if a Low Supply alert should be
"^DD",9999999.41,9999999.41,.15,21,2,0)
issued.  The number must be between 0 and 99,998 and cannot be greater
"^DD",9999999.41,9999999.41,.15,21,3,0)
than the STARTING COUNT.
"^DD",9999999.41,9999999.41,.15,23,0)
^.001^2^2^3150416^^^
"^DD",9999999.41,9999999.41,.15,23,1,0)
A number field between 0 and 99998.  Input Transform also checks that the
"^DD",9999999.41,9999999.41,.15,23,2,0)
entry is not greater than the number in the STARTING COUNT field.
"^DD",9999999.41,9999999.41,.15,"AUDIT")
y
"^DD",9999999.41,9999999.41,.15,"DT")
3150720
"^DD",9999999.41,9999999.41,.16,0)
LOT NUMBER FOR EXPORT^Fa^^0;16^K:$L(X)>12!($L(X)<3) X
"^DD",9999999.41,9999999.41,.16,.1)
Lot Number For Export
"^DD",9999999.41,9999999.41,.16,3)
Enter the official lot number to be used for export to other registries, 3 to 12 characters in length.
"^DD",9999999.41,9999999.41,.16,21,0)
^^2^2^3140829^^
"^DD",9999999.41,9999999.41,.16,21,1,0)
This is this lot number's corresponding official lot number to be used
"^DD",9999999.41,9999999.41,.16,21,2,0)
for exporting to other registries.
"^DD",9999999.41,9999999.41,.16,23,0)
^.001^3^3^3140829^^^
"^DD",9999999.41,9999999.41,.16,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.16,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.16,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.16,"AUDIT")
y
"^DD",9999999.41,9999999.41,.16,"DT")
3150720
"^DD",9999999.41,9999999.41,.17,0)
NDC CODE^P9002084.95'a^BINDC(^0;17^Q
"^DD",9999999.41,9999999.41,.17,.1)
NDC Code
"^DD",9999999.41,9999999.41,.17,3)
Select the NDC Code for this lot.
"^DD",9999999.41,9999999.41,.17,21,0)
^.001^1^1^3140829^^^^
"^DD",9999999.41,9999999.41,.17,21,1,0)
This is the NDC Code for this lot.
"^DD",9999999.41,9999999.41,.17,23,0)
^.001^6^6^3140829^^
"^DD",9999999.41,9999999.41,.17,23,1,0)
This field is not used by the Department of Veterans Affairs.  It is 
"^DD",9999999.41,9999999.41,.17,23,2,0)
included for backward compatibility with the Indian Health Service version
"^DD",9999999.41,9999999.41,.17,23,3,0)
of the file.
"^DD",9999999.41,9999999.41,.17,23,4,0)
 
"^DD",9999999.41,9999999.41,.17,23,5,0)
This field points to Indian Health Service's BI TABLE NDC CODES file
"^DD",9999999.41,9999999.41,.17,23,6,0)
(#9002084.95) which is not used by the Department of Veterans Affairs.
"^DD",9999999.41,9999999.41,.17,"AUDIT")
y
"^DD",9999999.41,9999999.41,.17,"DT")
3150720
"^DD",9999999.41,9999999.41,.18,0)
NDC CODE (VA)^P50.67'a^PSNDF(50.67,^0;18^Q
"^DD",9999999.41,9999999.41,.18,.1)
NDC Code
"^DD",9999999.41,9999999.41,.18,3)
Select the NDC Code for this lot.
"^DD",9999999.41,9999999.41,.18,21,0)
^^1^1^3150720^
"^DD",9999999.41,9999999.41,.18,21,1,0)
This is the NDC/UPN code for this lot.
"^DD",9999999.41,9999999.41,.18,"AUDIT")
y
"^DD",9999999.41,9999999.41,.18,"DT")
3150720
"^DIC",9000010.11,9000010.11,0)
V IMMUNIZATION^9000010.11IP
"^DIC",9000010.11,9000010.11,0,"GL")
^AUPNVIMM(
"^DIC",9000010.11,9000010.11,"%",0)
^1.005^^0
"^DIC",9000010.11,9000010.11,"%D",0)
13^1.001^20^20^3141103^^^^
"^DIC",9000010.11,9000010.11,"%D",1,0)
In order to preserve the continuity of files shared by the Indian Health 
"^DIC",9000010.11,9000010.11,"%D",2,0)
Service and the Department of Veterans Affairs, this file includes fields 
"^DIC",9000010.11,9000010.11,"%D",3,0)
used by Indian Health Service that will not be used by the Department of 
"^DIC",9000010.11,9000010.11,"%D",4,0)
Veterans Affairs. These fields may point to other files and routines not 
"^DIC",9000010.11,9000010.11,"%D",5,0)
deployed by the Department of Veterans Affairs. Inclusion of these fields, 
"^DIC",9000010.11,9000010.11,"%D",6,0)
as designed, was approved by the DBA.  These fields were initially 
"^DIC",9000010.11,9000010.11,"%D",7,0)
introduced with the release of the VISTA IMMUNIZATION ENHANCEMENTS 1.0 
"^DIC",9000010.11,9000010.11,"%D",8,0)
(PX*1*201) for the VistA Immunization Enhancements Project.  Additional 
"^DIC",9000010.11,9000010.11,"%D",9,0)
fields may be included in later enhancements.  
"^DIC",9000010.11,9000010.11,"%D",10,0)
  
"^DIC",9000010.11,9000010.11,"%D",11,0)
This file contains immunizations specific to a particular visit for a 
"^DIC",9000010.11,9000010.11,"%D",12,0)
particular patient.  This file contains one record for each immunization.
"^DIC",9000010.11,9000010.11,"%D",13,0)
 
"^DIC",9000010.11,9000010.11,"%D",14,0)
In the VA, if a CPT code is entered into PCE that represents an
"^DIC",9000010.11,9000010.11,"%D",15,0)
immunization, than an immunization will automatically be entered in the V
"^DIC",9000010.11,9000010.11,"%D",16,0)
Immunization file.  And vice versa, if an immunization is entered into PCE
"^DIC",9000010.11,9000010.11,"%D",17,0)
that has a related CPT code, then a V CPT entry will automatically be
"^DIC",9000010.11,9000010.11,"%D",18,0)
created with the CPT code for the immunization.  The PCE Code Mapping file
"^DIC",9000010.11,9000010.11,"%D",19,0)
contains the definitions of what immunization is related to what CPT code,
"^DIC",9000010.11,9000010.11,"%D",20,0)
and vice versa.
"^DIC",9000010.11,"B","V IMMUNIZATION",9000010.11)

"^DIC",9000010.12,9000010.12,0)
V SKIN TEST^9000010.12IP
"^DIC",9000010.12,9000010.12,0,"GL")
^AUPNVSK(
"^DIC",9000010.12,9000010.12,"%D",0)
^^16^16^2960809^^^^
"^DIC",9000010.12,9000010.12,"%D",1,0)
This file has been designed for joint use by the Indian Health Service and
"^DIC",9000010.12,9000010.12,"%D",2,0)
the Department of Veteran Affairs. There will be one record for each type
"^DIC",9000010.12,9000010.12,"%D",3,0)
of skin test given to a patient on a given visit.  Data must exist for a
"^DIC",9000010.12,9000010.12,"%D",4,0)
patient and a visit before data can be entered here.  The record is
"^DIC",9000010.12,9000010.12,"%D",5,0)
normally created when a skin test is given, and the results, if available,
"^DIC",9000010.12,9000010.12,"%D",6,0)
are entered at a later date and matched to the original record.  If
"^DIC",9000010.12,9000010.12,"%D",7,0)
results are entered and a skin test given does not exist, a new record is
"^DIC",9000010.12,9000010.12,"%D",8,0)
created.
"^DIC",9000010.12,9000010.12,"%D",9,0)
 
"^DIC",9000010.12,9000010.12,"%D",10,0)
In the VA, If a CPT code is entered into PCE that represents a skin test,
"^DIC",9000010.12,9000010.12,"%D",11,0)
then a skin test entry will automatically be entered into the V Skin Test
"^DIC",9000010.12,9000010.12,"%D",12,0)
file.  And vice versa, if a skin test is entered into PCE that represents
"^DIC",9000010.12,9000010.12,"%D",13,0)
a CPT code, then a CPT entry will automatically be entered into the V CPT
"^DIC",9000010.12,9000010.12,"%D",14,0)
file.  This supports getting workload credit from clinical activities.
"^DIC",9000010.12,9000010.12,"%D",15,0)
The PCE Code Mapping file defines the relationships between Skin Tests and
"^DIC",9000010.12,9000010.12,"%D",16,0)
CPT codes.
"^DIC",9000010.12,"B","V SKIN TEST",9000010.12)

"^DIC",9999999.41,9999999.41,0)
IMMUNIZATION LOT^9999999.41
"^DIC",9999999.41,9999999.41,0,"GL")
^AUTTIML(
"^DIC",9999999.41,9999999.41,"%",0)
^1.005^^
"^DIC",9999999.41,9999999.41,"%D",0)
^1.001^16^16^3141103^^^^
"^DIC",9999999.41,9999999.41,"%D",1,0)
In order to preserve the continuity of files shared by the Indian Health 
"^DIC",9999999.41,9999999.41,"%D",2,0)
Service and the Department of Veterans Affairs, this file includes fields 
"^DIC",9999999.41,9999999.41,"%D",3,0)
used by Indian Health Service that will not be used by the Department of 
"^DIC",9999999.41,9999999.41,"%D",4,0)
Veterans Affairs. These fields may point to other files and routines not 
"^DIC",9999999.41,9999999.41,"%D",5,0)
deployed by the Department of Veterans Affairs. Inclusion of these fields, 
"^DIC",9999999.41,9999999.41,"%D",6,0)
as designed, was approved by the DBA.  These fields were initially 
"^DIC",9999999.41,9999999.41,"%D",7,0)
introduced with the release of the VISTA IMMUNIZATION ENHANCEMENTS 1.0 
"^DIC",9999999.41,9999999.41,"%D",8,0)
(PX*1*201) for the VistA Immunization Enhancements Project.  Additional 
"^DIC",9999999.41,9999999.41,"%D",9,0)
fields may be included in later enhancements.  
"^DIC",9999999.41,9999999.41,"%D",10,0)
  
"^DIC",9999999.41,9999999.41,"%D",11,0)
This file contains the Immunization Manufacturers' LOT NUMBERS for the 
"^DIC",9999999.41,9999999.41,"%D",12,0)
immunizations/vaccines administered in the VA.  The LOT NUMBERs themselves
"^DIC",9999999.41,9999999.41,"%D",13,0)
may not be unique, but the combination of LOT NUMBER and MANUFACTURER
"^DIC",9999999.41,9999999.41,"%D",14,0)
must form a unique entry.  This file also relies on a nightly background
"^DIC",9999999.41,9999999.41,"%D",15,0)
task that checks the entries' EXPIRATION DATE field.  If the date is equal
"^DIC",9999999.41,9999999.41,"%D",16,0)
to that day's date, or has passed, that entry's STATUS is set to EXPIRED.
"^DIC",9999999.41,"B","IMMUNIZATION LOT",9999999.41)

"BLD",9275,6)
3^
**END**
**END**
