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

DGRRLU5.m

Go to the documentation of this file.
  1. DGRRLU5 ; ALB/sgg/MM - DG Replacement and Rehosting RPC for VADPT ; May-4-2004 ;
  1. ;;5.3;Registration;**538**;Aug 13, 1993
  1. ; provider lookup
  1. ; called by DGRRLU at line PRVLUP^DGRRLU5 if PARAMS("SEARCH_TYPE") = "PRVLUP"
  1. ;
  1. ;
  1. DOC ;INPUT: Input is by the following parameters in the PARAMS() array:
  1. ;
  1. ;"PRV_VPID" - VPID [Required VPID unless PRV_LNAM is not Null.]
  1. ; If not null the query will only return the one person
  1. ; with this VPID, and only then if SSN, PROV and STN filters
  1. ; do not exclude this person.
  1. ;"PRV_LNAM" - LAST NAME [Required Char String unless VPID is not Null.]
  1. ; If not null the query will only return persons whose
  1. ; last name starts with this string.
  1. ;"PRV_FNAM" - FIRST NAME [Optional: Character String or Null.]
  1. ; If not null the query will only return persons whose
  1. ; first name starts with this string.
  1. ;"PRV_SSN" - SSN FILTER [Optional: 9 digits or Null.]
  1. ; If not null the query will only return persons with
  1. ; this social security number.
  1. ;"PRV_PROV" - PROVIDER FILTER [Optional: "P" or Null.]
  1. ; If set to "P" the query includes only providers, i.e.
  1. ; persons with a person class active on the PRV_DATE.
  1. ;"PRV_STN" - STATION NUMBER FILTER [Optional: an STN or Null.]
  1. ; If not null the query only returns persons with this
  1. ; station number.
  1. ;"PRV_MNM" - MAXIMUM NUMBER [Optional: min=1 max=50 default=50.]
  1. ; The maximum number of persons the query will return.
  1. ; If VPID is not null this is always 1.
  1. ;"PRV_DATE" - DATE [Optional: if Null this defaults to Today.]
  1. ; The Date against which a persons active person class is
  1. ; determined.
  1. ;
  1. ;OUTPUT: Output an XML with a schema as given:
  1. ;
  1. ; <?xml version="1.0" encoding="utf-8" ?>
  1. ; <persons> Example Data
  1. ; <person>
  1. ; </vpid> 999999999
  1. ; </ien> 11579
  1. ; </lname> KRUSHER
  1. ; </fname> WILL
  1. ; </mname> MIDDIE
  1. ; </ssn> 232323232
  1. ; </dob> 2330303
  1. ; </sex> M
  1. ; <providerInfo>
  1. ; </type> Physician Assistants
  1. ; </classification> Physician Assistant
  1. ; </specialization> Medical
  1. ; </VACode> V100100
  1. ; </X12Code> 363AM0700N
  1. ; </SpecialityCode> 97
  1. ; </providerInfo>
  1. ; </person>
  1. ; <error message=''></error>
  1. ; <maximum message=''></maximum>
  1. ; <record count='1'></record>
  1. ; <institution name='ALBANY' number='500' productiondatabase='0' domain='DMA.FO-ALBANY.DOMAIN.EXT' ></institution>
  1. ; </persons>
  1. ;
  1. ;
  1. PRVLUP(RESULT,PARAMS) ;
  1. NEW DGRRVPID,DGRRLNAM,DGRRFNAM,DGRRSSN,DGRRPROV,DGRRSTN,DGRRMNM,DGRRDATE
  1. SET DGRRVPID=$G(PARAMS("PRV_VPID")) ; - The VPID of a Provider (Required unless lookup is by Provider Name)
  1. SET DGRRLNAM=$G(PARAMS("PRV_LNAM")) ; - Part or all of the last name to use for basis of query (Required unless lookup is by VPID)
  1. SET DGRRFNAM=$G(PARAMS("PRV_FNAM")) ; - Part or all of the first name to use for basis of query filter (optional, can be null)
  1. SET DGRRSSN=$G(PARAMS("PRV_SSN")) ; - Social Security Number (null or full 9 digits) to use as additional filter for query
  1. SET DGRRPROV=$G(PARAMS("PRV_PROV")) ; - If value set to "P", screen for only providers (only persons with active person class)
  1. SET DGRRSTN=$G(PARAMS("PRV_STN")) ; - Filter persons based on station number entered (optional, can be null)
  1. SET DGRRMNM=$G(PARAMS("PRV_MNM")) ; - Maximum Number of entries to return (Number between 1 and 50. Null defaults to 50)
  1. SET DGRRDATE=$G(PARAMS("PRV_DATE")) ; - Date to be used to determine whether person has active person class. If null, current date is used.
  1. ;
  1. N DGRRARR,DGRRCNT,ERRMESS,DGRRGLB
  1. DO ADD("<persons>")
  1. SET DGRRCNT=0 ;Initialize Record Count
  1. IF (DGRRLNAM=""),(DGRRVPID="") SET ERRMESS="Query requires a last name or a VPID." GOTO FINALLY
  1. ;
  1. D EN1^XUPSQRY(.DGRRARR,DGRRVPID,DGRRLNAM,DGRRFNAM,DGRRSSN,DGRRPROV,DGRRSTN,DGRRMNM,DGRRDATE)
  1. K ^TMP($J,"PLUQRY")
  1. M ^TMP($J,"PLUQRY")=@DGRRARR
  1. I '$D(^TMP($J,"PLUQRY",1))!($G(^TMP($J,"PLUQRY",1))=0) D Q
  1. .S ERRMESS="No records found."
  1. .D FINALLY
  1. N DGRRI,DGRRCNT
  1. S (DGRRI,DGRRCNT)=0
  1. F S DGRRI=$O(^TMP($J,"PLUQRY",DGRRI)) Q:DGRRI="" D
  1. .N DGRR0,DGRR1,DGRR2,DGRR3,DGRR4,DGRRVPID,DGRRIEN,DGRRNM,DGRRSSN,DGRRDOB,DGRRSEX
  1. .S DGRRCNT=DGRRCNT+1
  1. .; DGRR0=VPID^IEN^Last Name~First Name~Middle Name^SSN^DOB^SEX
  1. .S DGRR0=$G(^TMP($J,"PLUQRY",DGRRCNT,0))
  1. .S DGRR1=$G(^TMP($J,"PLUQRY",DGRRCNT,1)) ;Provider Type
  1. .S DGRR2=$G(^TMP($J,"PLUQRY",DGRRCNT,2)) ;Provider Classification
  1. .S DGRR3=$G(^TMP($J,"PLUQRY",DGRRCNT,3)) ;Area of Specialization
  1. .; DGRR4=VA Code^X12 Code^Specialty Code
  1. .S DGRR4=$G(^TMP($J,"PLUQRY",DGRRCNT,4))
  1. .S DGRRVPID=$P(DGRR0,U)
  1. .S DGRRIEN=$P(DGRR0,U,2)
  1. .S DGRRNM=$P(DGRR0,U,3)
  1. .S DGRRSSN=$P(DGRR0,U,4)
  1. .S DGRRDOB=$P(DGRR0,U,5)
  1. .S DGRRSEX=$P(DGRR0,U,6)
  1. .D FOUND
  1. D FINALLY
  1. Q
  1. ;
  1. FINALLY DO ADD("<error message='"_$G(ERRMESS)_"'></error>")
  1. DO ADD("<maximum message=''></maximum>")
  1. DO ADD("<record count='"_DGRRCNT_"'></record>")
  1. I $G(DGRRARR)'="" K @DGRRARR
  1. K ^TMP($J,"PLUQRY")
  1. Q
  1. ;
  1. FOUND ;Build XML of found records
  1. ;
  1. DO ADD("<person>")
  1. DO ADD("<vpid>"_$$CHARCHK^DGRRUTL(DGRRVPID)_"</vpid>")
  1. DO ADD("<ien>"_$$CHARCHK^DGRRUTL(DGRRIEN)_"</ien>")
  1. DO ADD("<lname>"_$$CHARCHK^DGRRUTL($P(DGRRNM,"~",1))_"</lname>")
  1. DO ADD("<fname>"_$$CHARCHK^DGRRUTL($P(DGRRNM,"~",2))_"</fname>")
  1. DO ADD("<mname>"_$$CHARCHK^DGRRUTL($P(DGRRNM,"~",3))_"</mname>")
  1. DO ADD("<ssn>"_$$CHARCHK^DGRRUTL(DGRRSSN)_"</ssn>")
  1. DO ADD("<dob>"_$$CHARCHK^DGRRUTL(DGRRDOB)_"</dob>")
  1. DO ADD("<sex>"_$$CHARCHK^DGRRUTL(DGRRSEX)_"</sex>")
  1. DO ADD("<providerInfo>")
  1. DO ADD("<type>"_$$CHARCHK^DGRRUTL($P(DGRR1,U))_"</type>")
  1. DO ADD("<classification>"_$$CHARCHK^DGRRUTL($P(DGRR2,U))_"</classification>")
  1. DO ADD("<specialization>"_$$CHARCHK^DGRRUTL($P(DGRR3,U))_"</specialization>")
  1. DO ADD("<VACode>"_$$CHARCHK^DGRRUTL($P(DGRR4,U))_"</VACode>")
  1. DO ADD("<X12Code>"_$$CHARCHK^DGRRUTL($P(DGRR4,U,2))_"</X12Code>")
  1. DO ADD("<SpecialityCode>"_$$CHARCHK^DGRRUTL($P(DGRR4,U,3))_"</SpecialityCode>")
  1. DO ADD("</providerInfo>")
  1. DO ADD("</person>")
  1. QUIT
  1. ;
  1. ADD(STR) ; add string to array
  1. SET DGRRLINE=DGRRLINE+1
  1. SET @DGRRESLT@(DGRRLINE)=STR
  1. QUIT