VPSMRAR0 ;DALOI/KML,WOIFO/BT - Update of VPS MRAR PDO file ;1/15/15 15:30
;;1.0;VA POINT OF SERVICE (KIOSKS);**3**;Jan 15, 2015;Build 64
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;
TABLE(ARRAY) ;build array of valid fields defined to VPS MRAR PDO (#853.5)
;input/output - ARRAY passed in by reference
; example of Array subset
; ARRAY("DEVICE ID")="853.51^.02"
; ARRAY("MODULE FUNCTION STATUS")="853.51^.07"
N LN,LINE,STRING
K ARRAY
F LN=2:1 S LINE=$T(MRARFLDS+LN),STRING=$P(LINE,";;",2) Q:STRING="" S ARRAY($P(STRING,U,3))=$P(STRING,U,1,2)_U_$P(STRING,U,4)_U_$P(STRING,U,5)
Q
;
ERROR(FDAERR,STRING,MSG) ;
; INPUT
; FDAERR : error array that was created when attempting to file the changes
; STRING : Field Name^IENS^Field Value
; IENS is composite string assigned to a subscript in the local array passed in by Vecna for the specific field
; MSG : message to be appended to the returned result
;
; OUTPUT
; No Exception : Field Name^IENS^Field Value^1
; With Exception : Field Name^IENS^Field Value^99^error
;
N RESULT
N ERRNUM S ERRNUM=0
S ERRNUM=$O(FDAERR("DIERR",ERRNUM))
N ERRTXT S ERRTXT=FDAERR("DIERR",ERRNUM,"TEXT",1)
N EXIST S EXIST=ERRTXT["already exists"
S:EXIST RESULT=$$RESULT(STRING,1,"") ; not an exception as far as Vecna is concerned.
S:'EXIST RESULT=$$RESULT(STRING,99,ERRTXT_$S(MSG'="":" "_MSG,1:""))
Q RESULT
;
RESULT(DATA,RETCODE,ERRMSG) ; return result with a structure recognized by vecna
; INPUT
; DATA : Field Name^IENS^Field Value
; IENS is composite string assigned to a subscript in the local array passed in by Vecna for the specific field
; RETCODE : Return Code
; ERRMSG : Error Message (optional)
;
; OUTPUT
; result string with a structure that Vecna can recognize
;
N RESULT
S RESULT=$P(DATA,U,1,3)
S $P(RESULT,U,4)=RETCODE
S:ERRMSG'="" $P(RESULT,U,5)=ERRMSG
Q RESULT
;
GREQFLD(VARRAY,DDARRY,REQFLDS) ;Build REQFLDS array. Each sub file must have the required field in the array otherwise generates error
; INPUTS
; VARRAY : encounter, statistics, allergy and medication related data sent in a subscripted array by kiosk client
; VARRAY(n) = FIELD NAME^ARRAY IENS^FIELD VALUE
; DDARRY : array of DD definitions defined at 853.51, 853.52, 853.53, 853.57 used for
; validating and filing the data sent by kiosk client
; each subscript at this array is constructed as:
; DDARRY(n) = FILE NUMBER^FIELD NUMBER^FIELD NAME
; OUTPUT
; REQFLDS : array of required field name by required fieldname and entry number
; if the required field name and value exists in VARRAY, the node (REQFLDS(reqfieldname, entry#)) will be defined.
;
; Required fields for Sub File 853.51
S REQFLDS("KIOSK GROUP")=0
S REQFLDS("ENCOUNTER CLINIC")=0
S REQFLDS("INTERFACE MODULE")=0
S REQFLDS("LOCAL ALLERGY ID")=1
S REQFLDS("REMOTE ALLERGY ID")=1
S REQFLDS("REMOTE ALLERGY NAME")=1
S REQFLDS("MED ID")=1
S REQFLDS("MEDICATION NAME")=1
S REQFLDS("ADD ALLERGY-VET")=1
S REQFLDS("ADD ALLERGY-PROVIDER")=1
S REQFLDS("PATIENT-FACING ADD MEDICATION")=1
S REQFLDS("STAFF VIEW ADD MEDICATION")=1
S REQFLDS("VET VIEW ADD MEDICATION")=1
S REQFLDS("LOCAL REACTION ID")=2
S REQFLDS("REMOTE REACTION ID")=2
S REQFLDS("REMOTE REACTION NAME")=2
;
N DDFLD,VPSFILE,FLDVAL,ENTRY2,ENTRY3
N SUB S SUB=""
;
F S SUB=$O(VARRAY(SUB)) Q:SUB="" D
. S DDFLD=$P(VARRAY(SUB),U) ; name of field label passed in by Vecna
. Q:DDFLD="" ;will generate error in the filing stage
. S ENTRY2=$P($P(VARRAY(SUB),U,2),",",2) ;Allergy or Medication Entry #
. S ENTRY3=$P($P(VARRAY(SUB),U,2),",",3) ;Reaction Entry #
. I $D(REQFLDS(DDFLD)) D
. . S FLDVAL=$$STRIP^XLFSTR($P(VARRAY(SUB),U,3)," ") ;IA #10104
. . I REQFLDS(DDFLD)=0 S REQFLDS(DDFLD,0)=1
. . I REQFLDS(DDFLD)=1,FLDVAL'="",ENTRY2'="" S REQFLDS(DDFLD,ENTRY2)=1
. . I REQFLDS(DDFLD)=2,FLDVAL'="",ENTRY2'="",ENTRY3'="" S REQFLDS(DDFLD,ENTRY2,ENTRY3)=1
Q
;
ADDMRAR(SUBFIL,SUBS,ENTRYNO,DIEFLAG) ;Add multiple entry
; INPUTS
; PTIEN : D0 - Patient DFN for 853.5 entry
; DTIEN : D1 - transaction date/time ien for 853.51 sub-entry
; ENTRYNO : Entry Number
; DIEFLAG : Filing Type (I = Internal, E = External)
; OUTPUT
; Success : > 0
; Failed : 0
N VPSFDA S VPSFDA(SUBFIL,"+1,"_SUBS_",",.01)=ENTRYNO
K ^TMP("DIERR",$J)
D UPDATE^DIE($G(DIEFLAG),"VPSFDA")
N ADDOK S ADDOK='$D(^TMP("DIERR",$J))
K ^TMP("DIERR",$J)
Q ADDOK
;
FILE(FIL,WP,IENS,FLD,DIEFLAG,DATA) ; Store field in FIL
; INPUTS
; FIL : File # where the data will be filed
; WP : Boolean indicates whether or not the field is a WP field
; IENS : IENS sub script where the data will be filed
; FLD : Field # where the data will be filed
; DIEFLAG : Filing Type (I = Internal, E = External)
; DATA : Field Name^IENS^Field Value
;
; OUTPUT
; success : RESULT = Field Name^IENS^Field Value^1
; failed : RESULT = Field Name^IENS^Field Value^99^error text describing why data did not get filed
;
N VPSERR
;
I WP D ; comments need to be filed using WP^DIE
. S DATA(1)=$P(DATA,U,3)
. D WP^DIE(FIL,IENS,FLD,"","DATA","VPSERR")
;
I 'WP D ; file other non-comments fields
. N VPSFDA
. S VPSFDA(FIL,IENS,FLD)=$P(DATA,U,3)
. D FILE^DIE(DIEFLAG,"VPSFDA","VPSERR")
;
I '$D(VPSERR) S RESULT=$$RESULT(DATA,1,"") ; data for specific field was filed successfully into PDO record
I $D(VPSERR) S RESULT=$$ERROR(.VPSERR,DATA,"")
;
Q RESULT
;
MRARFLDS ; list of encounter, MRAR, and Kiosk statistics fields defined in VPS MRAR PDO file (#853.5)
;;FILE NUMBER^FIELD NUMBER^FIELD NAME^comments
;;853.51^.02^DEVICE ID^E
;;853.51^.03^KIOSK GROUP^E
;;853.51^.04^ENCOUNTER CLINIC^I^44
;;853.51^.05^APPT DATE/TIME^D
;;853.51^.06^PROVIDER^I^200
;;853.51^.12^MRAR SESSION ID^E
;;853.51^1^AR INITIATED DT^D
;;853.51^2^AR COMPLETED DT^D
;;853.51^5^AR INCOMPLETE DT^D
;;853.51^6^AR INCOMPLETE REASON TYPE^E
;;853.51^7^AR SESSION OUTCOME^E
;;853.51^8^ADD ALLERGY INITIATED DT^D
;;853.51^9^ADD ALLERGY COMPLETED DT^D
;;853.51^10^ALLER CHANGE COMPLETED DT^D
;;853.51^11^ALLER CHANGE INITIATED DT^D
;;853.51^12^AR FREE TEXT USED^E
;;853.51^13^AR FREE TEXT COMPLETED DT^D
;;853.51^14^VET VIEW ADD ALLERGY COMP DT^D
;;853.51^15^VET VIEW ADD ALLER INIT DT^D
;;853.51^16^VET VIEW CHANGE ALLER COMP DT^D
;;853.51^17^VET VIEW CHANGE ALLER INIT DT^D
;;853.51^18^MR CHANGE REASON INITIATED DT^D
;;853.51^19^OTH ALLERGY UNK PATIENT^E
;;853.51^20^NO KNOWN DRUG ALLERGIES^E
;;853.51^22^MR MULTIPLE SESSIONS^E
;;853.51^23^MR FREE TEXT USED^E
;;853.51^24^VET VIEW CHG DOD MED COMP DT^D
;;853.51^25^VET VIEW CHG DOD MED INIT DT^D
;;853.51^26^VET VIEW CHG NONVA MED COMP DT^D
;;853.51^27^VET VIEW CHG NONVA MED INIT DT^D
;;853.51^28^VET VIEW CHG LOCAL MED COMP DT^D
;;853.51^29^VET VIEW CHG LOCAL MED INIT DT^D
;;853.51^31^VET VIEW CHG REMOT MED COMP DT^D
;;853.51^32^VET VIEW CHG REMOT MED INIT DT^D
;;853.51^33^WEB ID^E
;;853.51^70^PDO FIRST INVOKED DT^D
;;853.51^72^PDO INVOCATION ERROR^E
;;853.51^73^PDO NEXT INVOKED DT^D
;;853.51^74^STAFF MODULE COMPLETED DT^D
;;853.51^76^STAFF MODULE SIGNED DT^D
;;853.51^77^MR INITIATED DT^D
;;853.51^78^MR COMPLETED DT^D
;;853.51^80^MR CHANGE MED INITIATED DT^D
;;853.51^81^MR CHANGE MED COMPLETED DT^D
;;853.51^82^MR CHANGE REASON COMPLETED DT^D
;;853.51^83^MR INCOMPLETE REASON TYPE^E
;;853.51^84^MR FREE TEXT SECTION DONE DT^D
;;853.51^85^MR SESSION OUTCOME^E
;;853.51^86^MR ADD MED INITIATED DT^D
;;853.51^87^MR ADD MED COMPLETED DT^D
;;853.51^88^VET VIEW ADD MED INITIATED DT^D
;;853.51^89^VET VIEW ADD MED COMPLETED DT^D
;;853.51^92^VET VIEW CHG ALL MED INIT DT^D
;;853.51^93^VET VIEW CHG ALL MED COMP DT^D
;;853.51^95^MR INCOMPLETE DT^D
;;853.51^105^TIU NOTE^I^8925
;;853.5121^.01^MRAR CONDUCTED WITH^E
;;853.52^.02^LOCAL ALLERGY ID^I^120.8
;;853.52^.03^REMOTE ALLERGY ID^E
;;853.52^.05^REMOTE ALLERGY NAME^E
;;853.52^.06^AR PATIENT RESPONSE^E
;;853.52^.09^REMOTE FACILITY^I^4
;;853.52^16^ALLERGY-MARK FOR FOLLOWUP^E
;;853.525^.01^ALLERGY CHANGED^I^853.3
;;853.526^.01^ALLERGY CONFIRMED^I^853.3
;;853.527^.01^ALLERGY DISCREPANCY^I^853.3
;;853.52^1^ALLERGY COMMENTS PATIENT^word processing field
;;853.52^2^ALLERGY COMMENTS STAFF VIEW^word processing field
;;853.52^3^ALLERGY COMMENTS VET VIEW^word processing field
;;853.52^4^ALLERGY DOD^E
;;853.53^1^ADD ALLERGY-VET^word processing field
;;853.53^1.5^ADD ALLERGY-PROVIDER^word processing field
;;853.53^2^ADD ALLERGY REACTION (STAFF)^E
;;853.53^3^ADD ALLERGY ADDED BY^E
;;853.53^4^ADD ALLERGY-MARK FOR FOLLOWUP^E
;;853.53^5^ADD ALLERGY NOT KNOWN^E
;;853.54^1^PRESCRIPTION ID^E
;;853.54^2^PROVIDER NAME^E
;;853.54^3^FILL LOCATION^I^4
;;853.54^4^LAST FILL DATE^D
;;853.54^5^DAYS SUPPLIED^E
;;853.54^6^# REFILLS LEFT^E
;;853.54^7^NEXT FILL DATE^D
;;853.54^8^MED EXPIRE DATE^D
;;853.54^9^MED ID^E
;;853.54^10^MEDICATION NAME^E
;;853.54^11^MR PRESET PATIENT RESPONSE^E
;;853.54^12^RX STATUS^E
;;853.54^13^MED SIG^E
;;853.54^14^MED DOSAGE^E
;;853.54^15^MED DOSAGE FORM^E
;;853.54^16^MEDS-MARK FOR FOLLOWUP^E
;;853.54^17^MED ROUTE^E
;;853.54^18^MED IMAGE INDICATOR^E
;;853.54^19^MED FINISHING PERSON^E
;;853.54^20^NATIONAL DRUG SID^E
;;853.54^21^NON-VA^E
;;853.54^22^MAX REFILLS^E
;;853.54^26^RX PATIENT STATUS^E
;;853.54^27^RX NUMBER^E
;;853.54^28^RX OUTPATIENT ID^E
;;853.54^29^RX SC FLAG^E
;;853.54^33^CANCEL DT^D
;;853.54^34^CMOP STATUS^E
;;853.54^35^COUNSELED FLAG^E
;;853.54^36^COUNSELING UNDERSTOOD FLAG^E
;;853.54^37^DIVISION SID^E
;;853.54^38^ENTERED BY^E
;;853.54^39^MED ISSUE DT^D
;;853.54^40^COPAY TRANSACTION^E
;;853.54^41^EBILL ACTION NUMBER^E
;;853.54^42^ETL BATCH ID FAILURE^E
;;853.54^43^RELEASE DT^D
;;853.54^44^QUANTITY SUPPLIED^E
;;853.54^45^MED REMOTE^E
;;853.54^46^REMOTE MED FACILITY^E
;;853.54^47^DRUG NAME W/O DOSE^E
;;853.54^48^HIGH RISK MED CLASS^E
;;853.54^49^HIGH RISK MED NAME^E
;;853.54^50^HIGH RISK MED YEAR^E
;;853.54^51^MED IMAGE^E
;;853.54^56^PRODUCT SOURCE^E
;;853.54^57^PRODUCT NAME^I^50.68
;;853.54^58^VET VIEW MED IMAGE INDICATOR^E
;;853.54^23^MEDICATION COMMENTS PATIENT^word processing field
;;853.54^24^MEDICATION COMMENTS STAFF VIEW^word processing field
;;853.54^25^MEDICATION COMMENTS VET VIEW^word processing field
;;853.5452^.01^MED DISCREPANCY^I^853.7
;;853.5454^.01^MED CHANGED^I^853.7
;;853.5455^.01^MED CONFIRMED^I^853.7
;;853.55^1^PATIENT-FACING ADD MEDICATION^E
;;853.55^2^STAFF VIEW ADD MEDICATION^E
;;853.55^3^VET VIEW ADD MEDICATION^E
;;853.55^4^VET PLANS TO DISCUSS ADD MED^E
;;853.55^5^ADD MED FREQUENCY (PATIENT)^E
;;853.55^6^ADD MED DIRECTIONS (PATIENT)^E
;;853.55^7^ADD MED COMMENTS-STAFF VIEW^word processing field
;;853.55^8^ADD MED DOSE (STAFF)^E
;;853.55^9^ADD MEDS-MARK FOR FOLLOW-UP^E
;;853.55^10^ADD MED INDICATION (STAFF)^E
;;853.55^11^ADD MED TIME (PATIENT)^E
;;853.55^12^ADD MED COMMENTS-VET VIEW^word processing field
;;853.57^.02^LOCAL REACTION ID^I^120.83
;;853.57^.03^REMOTE REACTION ID^E
;;853.57^.04^REMOTE REACTION NAME^E
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVPSMRAR0 11399 printed Dec 13, 2024@02:43:05 Page 2
VPSMRAR0 ;DALOI/KML,WOIFO/BT - Update of VPS MRAR PDO file ;1/15/15 15:30
+1 ;;1.0;VA POINT OF SERVICE (KIOSKS);**3**;Jan 15, 2015;Build 64
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
TABLE(ARRAY) ;build array of valid fields defined to VPS MRAR PDO (#853.5)
+1 ;input/output - ARRAY passed in by reference
+2 ; example of Array subset
+3 ; ARRAY("DEVICE ID")="853.51^.02"
+4 ; ARRAY("MODULE FUNCTION STATUS")="853.51^.07"
+5 NEW LN,LINE,STRING
+6 KILL ARRAY
+7 FOR LN=2:1
SET LINE=$TEXT(MRARFLDS+LN)
SET STRING=$PIECE(LINE,";;",2)
if STRING=""
QUIT
SET ARRAY($PIECE(STRING,U,3))=$PIECE(STRING,U,1,2)_U_$PIECE(STRING,U,4)_U_$PIECE(STRING,U,5)
+8 QUIT
+9 ;
ERROR(FDAERR,STRING,MSG) ;
+1 ; INPUT
+2 ; FDAERR : error array that was created when attempting to file the changes
+3 ; STRING : Field Name^IENS^Field Value
+4 ; IENS is composite string assigned to a subscript in the local array passed in by Vecna for the specific field
+5 ; MSG : message to be appended to the returned result
+6 ;
+7 ; OUTPUT
+8 ; No Exception : Field Name^IENS^Field Value^1
+9 ; With Exception : Field Name^IENS^Field Value^99^error
+10 ;
+11 NEW RESULT
+12 NEW ERRNUM
SET ERRNUM=0
+13 SET ERRNUM=$ORDER(FDAERR("DIERR",ERRNUM))
+14 NEW ERRTXT
SET ERRTXT=FDAERR("DIERR",ERRNUM,"TEXT",1)
+15 NEW EXIST
SET EXIST=ERRTXT["already exists"
+16 ; not an exception as far as Vecna is concerned.
if EXIST
SET RESULT=$$RESULT(STRING,1,"")
+17 if 'EXIST
SET RESULT=$$RESULT(STRING,99,ERRTXT_$SELECT(MSG'="":" "_MSG,1:""))
+18 QUIT RESULT
+19 ;
RESULT(DATA,RETCODE,ERRMSG) ; return result with a structure recognized by vecna
+1 ; INPUT
+2 ; DATA : Field Name^IENS^Field Value
+3 ; IENS is composite string assigned to a subscript in the local array passed in by Vecna for the specific field
+4 ; RETCODE : Return Code
+5 ; ERRMSG : Error Message (optional)
+6 ;
+7 ; OUTPUT
+8 ; result string with a structure that Vecna can recognize
+9 ;
+10 NEW RESULT
+11 SET RESULT=$PIECE(DATA,U,1,3)
+12 SET $PIECE(RESULT,U,4)=RETCODE
+13 if ERRMSG'=""
SET $PIECE(RESULT,U,5)=ERRMSG
+14 QUIT RESULT
+15 ;
GREQFLD(VARRAY,DDARRY,REQFLDS) ;Build REQFLDS array. Each sub file must have the required field in the array otherwise generates error
+1 ; INPUTS
+2 ; VARRAY : encounter, statistics, allergy and medication related data sent in a subscripted array by kiosk client
+3 ; VARRAY(n) = FIELD NAME^ARRAY IENS^FIELD VALUE
+4 ; DDARRY : array of DD definitions defined at 853.51, 853.52, 853.53, 853.57 used for
+5 ; validating and filing the data sent by kiosk client
+6 ; each subscript at this array is constructed as:
+7 ; DDARRY(n) = FILE NUMBER^FIELD NUMBER^FIELD NAME
+8 ; OUTPUT
+9 ; REQFLDS : array of required field name by required fieldname and entry number
+10 ; if the required field name and value exists in VARRAY, the node (REQFLDS(reqfieldname, entry#)) will be defined.
+11 ;
+12 ; Required fields for Sub File 853.51
+13 SET REQFLDS("KIOSK GROUP")=0
+14 SET REQFLDS("ENCOUNTER CLINIC")=0
+15 SET REQFLDS("INTERFACE MODULE")=0
+16 SET REQFLDS("LOCAL ALLERGY ID")=1
+17 SET REQFLDS("REMOTE ALLERGY ID")=1
+18 SET REQFLDS("REMOTE ALLERGY NAME")=1
+19 SET REQFLDS("MED ID")=1
+20 SET REQFLDS("MEDICATION NAME")=1
+21 SET REQFLDS("ADD ALLERGY-VET")=1
+22 SET REQFLDS("ADD ALLERGY-PROVIDER")=1
+23 SET REQFLDS("PATIENT-FACING ADD MEDICATION")=1
+24 SET REQFLDS("STAFF VIEW ADD MEDICATION")=1
+25 SET REQFLDS("VET VIEW ADD MEDICATION")=1
+26 SET REQFLDS("LOCAL REACTION ID")=2
+27 SET REQFLDS("REMOTE REACTION ID")=2
+28 SET REQFLDS("REMOTE REACTION NAME")=2
+29 ;
+30 NEW DDFLD,VPSFILE,FLDVAL,ENTRY2,ENTRY3
+31 NEW SUB
SET SUB=""
+32 ;
+33 FOR
SET SUB=$ORDER(VARRAY(SUB))
if SUB=""
QUIT
Begin DoDot:1
+34 ; name of field label passed in by Vecna
SET DDFLD=$PIECE(VARRAY(SUB),U)
+35 ;will generate error in the filing stage
if DDFLD=""
QUIT
+36 ;Allergy or Medication Entry #
SET ENTRY2=$PIECE($PIECE(VARRAY(SUB),U,2),",",2)
+37 ;Reaction Entry #
SET ENTRY3=$PIECE($PIECE(VARRAY(SUB),U,2),",",3)
+38 IF $DATA(REQFLDS(DDFLD))
Begin DoDot:2
+39 ;IA #10104
SET FLDVAL=$$STRIP^XLFSTR($PIECE(VARRAY(SUB),U,3)," ")
+40 IF REQFLDS(DDFLD)=0
SET REQFLDS(DDFLD,0)=1
+41 IF REQFLDS(DDFLD)=1
IF FLDVAL'=""
IF ENTRY2'=""
SET REQFLDS(DDFLD,ENTRY2)=1
+42 IF REQFLDS(DDFLD)=2
IF FLDVAL'=""
IF ENTRY2'=""
IF ENTRY3'=""
SET REQFLDS(DDFLD,ENTRY2,ENTRY3)=1
End DoDot:2
End DoDot:1
+43 QUIT
+44 ;
ADDMRAR(SUBFIL,SUBS,ENTRYNO,DIEFLAG) ;Add multiple entry
+1 ; INPUTS
+2 ; PTIEN : D0 - Patient DFN for 853.5 entry
+3 ; DTIEN : D1 - transaction date/time ien for 853.51 sub-entry
+4 ; ENTRYNO : Entry Number
+5 ; DIEFLAG : Filing Type (I = Internal, E = External)
+6 ; OUTPUT
+7 ; Success : > 0
+8 ; Failed : 0
+9 NEW VPSFDA
SET VPSFDA(SUBFIL,"+1,"_SUBS_",",.01)=ENTRYNO
+10 KILL ^TMP("DIERR",$JOB)
+11 DO UPDATE^DIE($GET(DIEFLAG),"VPSFDA")
+12 NEW ADDOK
SET ADDOK='$DATA(^TMP("DIERR",$JOB))
+13 KILL ^TMP("DIERR",$JOB)
+14 QUIT ADDOK
+15 ;
FILE(FIL,WP,IENS,FLD,DIEFLAG,DATA) ; Store field in FIL
+1 ; INPUTS
+2 ; FIL : File # where the data will be filed
+3 ; WP : Boolean indicates whether or not the field is a WP field
+4 ; IENS : IENS sub script where the data will be filed
+5 ; FLD : Field # where the data will be filed
+6 ; DIEFLAG : Filing Type (I = Internal, E = External)
+7 ; DATA : Field Name^IENS^Field Value
+8 ;
+9 ; OUTPUT
+10 ; success : RESULT = Field Name^IENS^Field Value^1
+11 ; failed : RESULT = Field Name^IENS^Field Value^99^error text describing why data did not get filed
+12 ;
+13 NEW VPSERR
+14 ;
+15 ; comments need to be filed using WP^DIE
IF WP
Begin DoDot:1
+16 SET DATA(1)=$PIECE(DATA,U,3)
+17 DO WP^DIE(FIL,IENS,FLD,"","DATA","VPSERR")
End DoDot:1
+18 ;
+19 ; file other non-comments fields
IF 'WP
Begin DoDot:1
+20 NEW VPSFDA
+21 SET VPSFDA(FIL,IENS,FLD)=$PIECE(DATA,U,3)
+22 DO FILE^DIE(DIEFLAG,"VPSFDA","VPSERR")
End DoDot:1
+23 ;
+24 ; data for specific field was filed successfully into PDO record
IF '$DATA(VPSERR)
SET RESULT=$$RESULT(DATA,1,"")
+25 IF $DATA(VPSERR)
SET RESULT=$$ERROR(.VPSERR,DATA,"")
+26 ;
+27 QUIT RESULT
+28 ;
MRARFLDS ; list of encounter, MRAR, and Kiosk statistics fields defined in VPS MRAR PDO file (#853.5)
+1 ;;FILE NUMBER^FIELD NUMBER^FIELD NAME^comments
+2 ;;853.51^.02^DEVICE ID^E
+3 ;;853.51^.03^KIOSK GROUP^E
+4 ;;853.51^.04^ENCOUNTER CLINIC^I^44
+5 ;;853.51^.05^APPT DATE/TIME^D
+6 ;;853.51^.06^PROVIDER^I^200
+7 ;;853.51^.12^MRAR SESSION ID^E
+8 ;;853.51^1^AR INITIATED DT^D
+9 ;;853.51^2^AR COMPLETED DT^D
+10 ;;853.51^5^AR INCOMPLETE DT^D
+11 ;;853.51^6^AR INCOMPLETE REASON TYPE^E
+12 ;;853.51^7^AR SESSION OUTCOME^E
+13 ;;853.51^8^ADD ALLERGY INITIATED DT^D
+14 ;;853.51^9^ADD ALLERGY COMPLETED DT^D
+15 ;;853.51^10^ALLER CHANGE COMPLETED DT^D
+16 ;;853.51^11^ALLER CHANGE INITIATED DT^D
+17 ;;853.51^12^AR FREE TEXT USED^E
+18 ;;853.51^13^AR FREE TEXT COMPLETED DT^D
+19 ;;853.51^14^VET VIEW ADD ALLERGY COMP DT^D
+20 ;;853.51^15^VET VIEW ADD ALLER INIT DT^D
+21 ;;853.51^16^VET VIEW CHANGE ALLER COMP DT^D
+22 ;;853.51^17^VET VIEW CHANGE ALLER INIT DT^D
+23 ;;853.51^18^MR CHANGE REASON INITIATED DT^D
+24 ;;853.51^19^OTH ALLERGY UNK PATIENT^E
+25 ;;853.51^20^NO KNOWN DRUG ALLERGIES^E
+26 ;;853.51^22^MR MULTIPLE SESSIONS^E
+27 ;;853.51^23^MR FREE TEXT USED^E
+28 ;;853.51^24^VET VIEW CHG DOD MED COMP DT^D
+29 ;;853.51^25^VET VIEW CHG DOD MED INIT DT^D
+30 ;;853.51^26^VET VIEW CHG NONVA MED COMP DT^D
+31 ;;853.51^27^VET VIEW CHG NONVA MED INIT DT^D
+32 ;;853.51^28^VET VIEW CHG LOCAL MED COMP DT^D
+33 ;;853.51^29^VET VIEW CHG LOCAL MED INIT DT^D
+34 ;;853.51^31^VET VIEW CHG REMOT MED COMP DT^D
+35 ;;853.51^32^VET VIEW CHG REMOT MED INIT DT^D
+36 ;;853.51^33^WEB ID^E
+37 ;;853.51^70^PDO FIRST INVOKED DT^D
+38 ;;853.51^72^PDO INVOCATION ERROR^E
+39 ;;853.51^73^PDO NEXT INVOKED DT^D
+40 ;;853.51^74^STAFF MODULE COMPLETED DT^D
+41 ;;853.51^76^STAFF MODULE SIGNED DT^D
+42 ;;853.51^77^MR INITIATED DT^D
+43 ;;853.51^78^MR COMPLETED DT^D
+44 ;;853.51^80^MR CHANGE MED INITIATED DT^D
+45 ;;853.51^81^MR CHANGE MED COMPLETED DT^D
+46 ;;853.51^82^MR CHANGE REASON COMPLETED DT^D
+47 ;;853.51^83^MR INCOMPLETE REASON TYPE^E
+48 ;;853.51^84^MR FREE TEXT SECTION DONE DT^D
+49 ;;853.51^85^MR SESSION OUTCOME^E
+50 ;;853.51^86^MR ADD MED INITIATED DT^D
+51 ;;853.51^87^MR ADD MED COMPLETED DT^D
+52 ;;853.51^88^VET VIEW ADD MED INITIATED DT^D
+53 ;;853.51^89^VET VIEW ADD MED COMPLETED DT^D
+54 ;;853.51^92^VET VIEW CHG ALL MED INIT DT^D
+55 ;;853.51^93^VET VIEW CHG ALL MED COMP DT^D
+56 ;;853.51^95^MR INCOMPLETE DT^D
+57 ;;853.51^105^TIU NOTE^I^8925
+58 ;;853.5121^.01^MRAR CONDUCTED WITH^E
+59 ;;853.52^.02^LOCAL ALLERGY ID^I^120.8
+60 ;;853.52^.03^REMOTE ALLERGY ID^E
+61 ;;853.52^.05^REMOTE ALLERGY NAME^E
+62 ;;853.52^.06^AR PATIENT RESPONSE^E
+63 ;;853.52^.09^REMOTE FACILITY^I^4
+64 ;;853.52^16^ALLERGY-MARK FOR FOLLOWUP^E
+65 ;;853.525^.01^ALLERGY CHANGED^I^853.3
+66 ;;853.526^.01^ALLERGY CONFIRMED^I^853.3
+67 ;;853.527^.01^ALLERGY DISCREPANCY^I^853.3
+68 ;;853.52^1^ALLERGY COMMENTS PATIENT^word processing field
+69 ;;853.52^2^ALLERGY COMMENTS STAFF VIEW^word processing field
+70 ;;853.52^3^ALLERGY COMMENTS VET VIEW^word processing field
+71 ;;853.52^4^ALLERGY DOD^E
+72 ;;853.53^1^ADD ALLERGY-VET^word processing field
+73 ;;853.53^1.5^ADD ALLERGY-PROVIDER^word processing field
+74 ;;853.53^2^ADD ALLERGY REACTION (STAFF)^E
+75 ;;853.53^3^ADD ALLERGY ADDED BY^E
+76 ;;853.53^4^ADD ALLERGY-MARK FOR FOLLOWUP^E
+77 ;;853.53^5^ADD ALLERGY NOT KNOWN^E
+78 ;;853.54^1^PRESCRIPTION ID^E
+79 ;;853.54^2^PROVIDER NAME^E
+80 ;;853.54^3^FILL LOCATION^I^4
+81 ;;853.54^4^LAST FILL DATE^D
+82 ;;853.54^5^DAYS SUPPLIED^E
+83 ;;853.54^6^# REFILLS LEFT^E
+84 ;;853.54^7^NEXT FILL DATE^D
+85 ;;853.54^8^MED EXPIRE DATE^D
+86 ;;853.54^9^MED ID^E
+87 ;;853.54^10^MEDICATION NAME^E
+88 ;;853.54^11^MR PRESET PATIENT RESPONSE^E
+89 ;;853.54^12^RX STATUS^E
+90 ;;853.54^13^MED SIG^E
+91 ;;853.54^14^MED DOSAGE^E
+92 ;;853.54^15^MED DOSAGE FORM^E
+93 ;;853.54^16^MEDS-MARK FOR FOLLOWUP^E
+94 ;;853.54^17^MED ROUTE^E
+95 ;;853.54^18^MED IMAGE INDICATOR^E
+96 ;;853.54^19^MED FINISHING PERSON^E
+97 ;;853.54^20^NATIONAL DRUG SID^E
+98 ;;853.54^21^NON-VA^E
+99 ;;853.54^22^MAX REFILLS^E
+100 ;;853.54^26^RX PATIENT STATUS^E
+101 ;;853.54^27^RX NUMBER^E
+102 ;;853.54^28^RX OUTPATIENT ID^E
+103 ;;853.54^29^RX SC FLAG^E
+104 ;;853.54^33^CANCEL DT^D
+105 ;;853.54^34^CMOP STATUS^E
+106 ;;853.54^35^COUNSELED FLAG^E
+107 ;;853.54^36^COUNSELING UNDERSTOOD FLAG^E
+108 ;;853.54^37^DIVISION SID^E
+109 ;;853.54^38^ENTERED BY^E
+110 ;;853.54^39^MED ISSUE DT^D
+111 ;;853.54^40^COPAY TRANSACTION^E
+112 ;;853.54^41^EBILL ACTION NUMBER^E
+113 ;;853.54^42^ETL BATCH ID FAILURE^E
+114 ;;853.54^43^RELEASE DT^D
+115 ;;853.54^44^QUANTITY SUPPLIED^E
+116 ;;853.54^45^MED REMOTE^E
+117 ;;853.54^46^REMOTE MED FACILITY^E
+118 ;;853.54^47^DRUG NAME W/O DOSE^E
+119 ;;853.54^48^HIGH RISK MED CLASS^E
+120 ;;853.54^49^HIGH RISK MED NAME^E
+121 ;;853.54^50^HIGH RISK MED YEAR^E
+122 ;;853.54^51^MED IMAGE^E
+123 ;;853.54^56^PRODUCT SOURCE^E
+124 ;;853.54^57^PRODUCT NAME^I^50.68
+125 ;;853.54^58^VET VIEW MED IMAGE INDICATOR^E
+126 ;;853.54^23^MEDICATION COMMENTS PATIENT^word processing field
+127 ;;853.54^24^MEDICATION COMMENTS STAFF VIEW^word processing field
+128 ;;853.54^25^MEDICATION COMMENTS VET VIEW^word processing field
+129 ;;853.5452^.01^MED DISCREPANCY^I^853.7
+130 ;;853.5454^.01^MED CHANGED^I^853.7
+131 ;;853.5455^.01^MED CONFIRMED^I^853.7
+132 ;;853.55^1^PATIENT-FACING ADD MEDICATION^E
+133 ;;853.55^2^STAFF VIEW ADD MEDICATION^E
+134 ;;853.55^3^VET VIEW ADD MEDICATION^E
+135 ;;853.55^4^VET PLANS TO DISCUSS ADD MED^E
+136 ;;853.55^5^ADD MED FREQUENCY (PATIENT)^E
+137 ;;853.55^6^ADD MED DIRECTIONS (PATIENT)^E
+138 ;;853.55^7^ADD MED COMMENTS-STAFF VIEW^word processing field
+139 ;;853.55^8^ADD MED DOSE (STAFF)^E
+140 ;;853.55^9^ADD MEDS-MARK FOR FOLLOW-UP^E
+141 ;;853.55^10^ADD MED INDICATION (STAFF)^E
+142 ;;853.55^11^ADD MED TIME (PATIENT)^E
+143 ;;853.55^12^ADD MED COMMENTS-VET VIEW^word processing field
+144 ;;853.57^.02^LOCAL REACTION ID^I^120.83
+145 ;;853.57^.03^REMOTE REACTION ID^E
+146 ;;853.57^.04^REMOTE REACTION NAME^E
+147 ;;