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

RMPFRPC1.m

Go to the documentation of this file.
  1. RMPFRPC1 ;DALC/PJU - Module to get Demographics for Patient ;06/18/08
  1. ;;3.0;REMOTE ORDER ENTRY SYSTEM;**1,4**;Feb 9, 2011;Build 19
  1. ;;Per VHA Directive 10-92-142 this routine should not be modified
  1. ;;Uses supported IA's: 2701, 4440, 10061
  1. ;;Added to IA: 767
  1. START(RE,DFN) ;Descrip of ret array(RE) in EXAMP at bottom of pg
  1. ;Called from RPC 'RMPFDEMOG' in Delphi routine uRMPFR3Patient.pas
  1. ;input: array name by ref, DFN
  1. ;output: 2 char term used in name-value pairs for URL
  1. I '$G(DFN) D G END
  1. .S ER="** Must have a DFN defined to continue. Exiting **"
  1. K RE ;can set param to clear between calls
  1. N ARR,BD,CL,CI,ED,EL,ER,ES,GP,ICN,L1,L2,L3
  1. N NM,PD,PN,PR,SR,SS,ST,TE,TD,VH,VT,ZP
  1. S (BD,CL,CI,ED,EL,ER,ES,GP,ICN,L1,L2,L3)=""
  1. S (NM,PD,PN,PR,SR,SS,ST,TE,TD,VH,VT,ZP)=""
  1. F X=0,11:1:31 S RE(X)=""
  1. D DEM^VADPT ; demographic vars
  1. I $G(VAERR) D G END
  1. .S ER="**Problem in retrieving Demographic values. Exiting.**"
  1. I $D(^DGSL(38.1,"B",DFN)) D ;IA#767
  1. .S SR=$O(^DGSL(38.1,"B",DFN,0)) ;ck for sensitive record
  1. .I SR,$P($G(^DGSL(38.1,SR,0)),U,2) S RE(26)=1
  1. S NM=$G(VADM(1)),RE(11)=NM ;name
  1. S SS=$P($G(VADM(2)),U,1),RE(12)=SS ;ssn
  1. S BD=$G(VADM(3)),RE(13)=BD ;DOB
  1. D ADD^VADPT ; current addr
  1. I $G(VAERR) D G END
  1. .S ER="**Problem in retrieving Address values. Exiting**"
  1. S L1=$G(VAPA(1)),RE(14)=L1
  1. S L2=$G(VAPA(2)),RE(15)=L2
  1. S L3=$G(VAPA(3)),RE(16)=L3
  1. S CI=$G(VAPA(4)),RE(17)=CI
  1. S ST=$P($G(VAPA(5)),U,1) ;State file pointer
  1. I 'ST D G END
  1. .S ER="**STATE field of address in local PATIENT record is missing. Exiting."
  1. E S X=ST,DIC="5",DIC(0)="NZ" D ^DIC K DIC D G:$L(ER) END
  1. .I +Y<1 K Y D Q
  1. ..S ER="**STATE field of address in local PATIENT record is not valid. Exiting."
  1. .S ST=$P(Y(0),U,2) K Y ;State abbrev
  1. S RE(18)=$P($G(VAPA(5)),U,1)_U_ST
  1. S ZP=$S($G(VAPA(11)):VAPA(11),1:VAPA(6)),RE(19)=$P(ZP,U,1)
  1. S TD=$G(VAPA(9)),RE(20)=TD
  1. S TE=$G(VAPA(10)),RE(21)=TE
  1. S PN=$G(VAPA(8)),RE(22)=PN
  1. END ;get eligibility information
  1. ;ARR is killed and re-set in RMPFRPC0
  1. D START^RMPFRPC0(.ARR,DFN) ;elig vars
  1. S RE(0)=$G(ARR(0)) ;FM DOD ^ external
  1. S RE(23)=DT ;$P(ARR(8),U,7) ;El stat dt - as of today
  1. S RE(24)=$G(ARR(2)) ;R3 calc elig code
  1. I RE(24)="" S RE(24)=$G(ARR(8)) ;just elig R3*4
  1. ;elig^app(1)/dis(0)/sub(2)/exp(3)^PSuser^ASuser^ReqDt^SugEl^ActDt
  1. S RE(25)=$P($G(ARR(3)),U,1) ;elig status
  1. I $L($G(ER)) S RE(27)=ER ;error msg from VADPT calls
  1. I $G(RE(27))="" S RE(27)=$G(ARR(5)) ;error msg from elig call
  1. S RE(28)=$G(ARR(6)) ;prim elig
  1. S RE(29)=$G(ARR(7)) ;priority group
  1. S ICN="",X="MPIF001" X ^%ZOSF("TEST")
  1. I $T S ICN=$$GETICN^MPIF001(DFN)
  1. S:(ICN<1) ICN="" ;"***ICN NOT FOUND***"
  1. S RE(30)=ICN
  1. S VH=0 ;ck for production account
  1. S X="XUPROD" X ^%ZOSF("TEST") I $T D
  1. .S VH=$$PROD^XUPROD()
  1. .I VH'=1 S VH=0
  1. S RE(31)=VH
  1. EXIT F X=11:1:31 S RE(X)=$$CLEAN(RE(X))
  1. ;ZW RE ;TESTING R3*4
  1. K S0,S1,S2,S6,YY,POP,VAERR
  1. D KVAR^VADPT
  1. Q
  1. ;
  1. CLEAN(RMVAR) ;Remove symbols that should not go through URL
  1. N RMPFRTN
  1. S RMPFRTN=$TR(RMVAR,"@#%?&/\*","")
  1. ENDC Q RMPFRTN
  1. ;
  1. EXAMP ;return sorted array to calling application
  1. ;RPCBroker lookup is done to retrieve the patient DFN.
  1. ;A call is then made to this routine through the RMPFDEMOG RPC.
  1. ;From the PATIENT file, we get the name, SSN, date of birth,
  1. ;current address, and temporary address parameters.
  1. ;will return to the Delphi app subscripts in same order
  1. ;created during calculation in the RE array (passed by ref)
  1. ;PD = RE(0)=date of death msg or ""
  1. ;NM = RE(11)=name
  1. ;SS = RE(12)=SSN
  1. ;BD = RE(13)=DOB
  1. ;L1 = RE(14)=current ad1
  1. ;L2 = RE(15)=current ad2
  1. ;L3 = RE(16)=current ad3
  1. ;CI = RE(17)=current city
  1. ;ST = RE(18)=current st
  1. ;ZP = RE(19)=current zip
  1. ;TD = RE(20)=t start date
  1. ;TE = RE(21)=t end date
  1. ;PN = RE(22)=current phone
  1. ;ED = RE(23)=eligibility status date FM
  1. ;EL = RE(24)=R3 elig cd ;;^1/2/3^PS-user^AS-user^reqDt^sugEl^actDt
  1. ;ES = RE(25)=eligibility status
  1. ;SR = RE(26)=sensitive record
  1. ;ER = RE(27)=error msg
  1. ;PR = RE(28)=primary elig
  1. ;GP = RE(29)=priority group
  1. ;ICN= RE(30)=Integration Control Number for MPI
  1. ;VH = RE(31)=1 if a production account