Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DGQERPC

DGQERPC.m

Go to the documentation of this file.
  1. DGQERPC ;ALB/RPM - VIC REPLACEMENT VISTA TO MAXIMUS RPC ; 10/04/05
  1. ;;5.3;Registration;**571,679,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ; This routine contains the primary entry points to the
  1. ; VistA to Maximus interface RPCs.
  1. ;
  1. Q ;no direct entry
  1. ;
  1. GETDEMO(RESULT,DGICN) ;retrieve patient demographics
  1. ;
  1. ; --rpc: DGQE GET PATIENT DEMO
  1. ;
  1. ; This remote procedure retrieves demographic data for a given patient
  1. ; and returns an array of text lines. Each text line consists of at
  1. ; least two circumflex("^")-delimited fields. The first field of each
  1. ; line contains an XML style tag (e.g. <RESULT>). The second through
  1. ; nth fields contain data.
  1. ;
  1. ; Supported References:
  1. ; DBIA #2701: $$GETDFN^MPIF001
  1. ;
  1. ; Input:
  1. ; DGICN - patient's Integration Control Number
  1. ;
  1. ; Output:
  1. ; RESULT - array of tag-labeled patient demographics
  1. ;
  1. ; Subscript Field# Field contents Description
  1. ; --------- ------ ------------------------- ----------------
  1. ; 1 1 <RESULT> RPC status tag
  1. ; 2 Card Print Release Status
  1. ; 3 "VIC"
  1. ;
  1. ; 2 1 <MSG> Remarks tag
  1. ; 2 Free text remarks
  1. ;
  1. ; 3 1 <NAME> Identifier tag
  1. ; 2 Full Name
  1. ; 3 Social Security Number
  1. ; 4 Date of Birth
  1. ;
  1. ; 4 1 <NAME1> Name components tag
  1. ; 2 Last Name
  1. ; 3 First Name
  1. ; 4 Middle Name
  1. ; 5 Name Suffix
  1. ; 6 Name Prefix
  1. ;
  1. ; 5 1 <TYPE> Veteran type tag
  1. ; 2 Service Connected Indicator
  1. ; 3 Prisoner of War Indicator
  1. ; 4 Purple Heart Indicator
  1. ;
  1. ; 6 1 <PATAS> Mailing address tag
  1. ; 2 Street Line 1
  1. ; 3 Street Line 2
  1. ; 4 Street Line 3
  1. ;
  1. ; 7 1 <PATAZ> Mailing address tag
  1. ; 2 City
  1. ; 3 State
  1. ; 4 Zip
  1. ;
  1. ; 8 1 <MPI> Master Patient Index tag
  1. ; 2 Integration Control Number
  1. ; 3 DFN
  1. ;
  1. ; 9 1 <SITE> Facility tag
  1. ; 2 Facility Name
  1. ; 3 Station Number
  1. ; 4 VISN
  1. ;
  1. N DGDFN ;pointer to patient in PATIENT (#2) file
  1. N DGVIC ;patient data array
  1. ;
  1. ;initialize patient data array
  1. D INITARR^DGQEUT1(.DGVIC)
  1. ;
  1. D ;drop out of block on error
  1. . ;
  1. . ;check for input parameter
  1. . S DGDFN=+$$GETDFN^MPIF001($G(DGICN))
  1. . Q:(DGDFN'>0)
  1. . ;
  1. . ;build patient object
  1. . Q:'$$GETPAT^DGQEUT1(DGDFN,.DGVIC)
  1. . ;
  1. . ;build eligibility object
  1. . Q:'$$GETELIG^DGQEUT1(DGDFN,.DGVIC)
  1. ;
  1. ;determine card print release status and get into array
  1. D CPRSTAT^DGQEUT2(.DGVIC)
  1. ;
  1. ;build results document
  1. D BLDDOC(.DGVIC,.RESULT)
  1. ;
  1. Q
  1. ;
  1. ;
  1. SETID(RESULT,DGICN,DGRSTAT,DGID) ;callback RPC from Maximus workstation
  1. ;
  1. ; --rpc: DGQE SET CARD ID
  1. ;
  1. ; This remote procedure provides a "callback" for the VIC PICS
  1. ; Workstation to notify VistA that a patient's VIC request has been
  1. ; successfully forwarded to the National Card Management Directory.
  1. ; The procedure creates an entry in the VIC REQUEST (#39.6) file when
  1. ; the Card Print Release Status is "H" [Hold].
  1. ;
  1. ; Supported References:
  1. ; DBIA #2701: $$GETDFN^MPIF001
  1. ;
  1. ; Input:
  1. ; DGICN - patient's Integration Control Number
  1. ; DGRSTAT - card print release status
  1. ; DGID - NCMD assigned Card ID
  1. ;
  1. ; Output:
  1. ; none
  1. ;
  1. N DGDFN ;pointer to patient in PATIENT (#2) file
  1. ;
  1. S DGDFN=+$$GETDFN^MPIF001($G(DGICN))
  1. I DGDFN>0,$D(^DPT(DGDFN,0)),$G(DGRSTAT)]"" D
  1. . I $E(DGRSTAT)="H" D STOCID^DGQEREQ(DGID,DGDFN,DGRSTAT)
  1. S RESULT=1
  1. ;
  1. Q
  1. ;
  1. ;
  1. BLDDOC(DGPAT,DGRSLT) ;build results document based on DOCMAP table
  1. ; This procedure uses the array subscript to field location table
  1. ; in linetag DOCMAP to format the GETDEMO RPC result array.
  1. ;
  1. ; Input:
  1. ; DGPAT - combined patient/eligibility data array
  1. ;
  1. ; Output:
  1. ; DGRSLT - RPC result array
  1. ;
  1. N DGFLD ;table field location
  1. N DGLCNT ;line count
  1. N DGLINE ;line content
  1. N DGFLDNM ;field name
  1. ;
  1. F DGLCNT=1:1 S DGLINE=$T(DOCMAP+DGLCNT) Q:DGLINE="" D
  1. . S DGRSLT(DGLCNT)="<"_$P(DGLINE,";",3)_">" ;set TAG
  1. . F DGFLD=4:1 S DGFLDNM=$P(DGLINE,";",DGFLD) Q:DGFLDNM="" D
  1. . . S DGRSLT(DGLCNT)=DGRSLT(DGLCNT)_"^"_$G(DGPAT(DGFLDNM))
  1. ;
  1. Q
  1. ;
  1. ;
  1. DOCMAP ;document field to array subscript map;TAG;FIELD1;FIELD2;...;FIELDn
  1. ;;RESULT;STAT;DOCTYPE
  1. ;;MSG;REMARKS
  1. ;;NAME;NAME;SSN;DOB
  1. ;;NAME1;LAST;FIRST;MIDDLE;SUFFIX;PREFIX
  1. ;;TYPE;SC;POW;PH
  1. ;;PATAS;STREET1;STREET2;STREET3
  1. ;;PATAZ;CITY;STATE;ZIP
  1. ;;MPI;ICN;DFN
  1. ;;SITE;FACNAME;FACNUM;VISN