Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (14 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/PATIENT_REPRESENTATIVE-QAC/QACVEMPX.m

    r628 r636  
    1 QACVEMPX ; OAKOIFO/TKW - Return Person Data, called by RPC ;9/25/07  14:14
    2  ;;2.0;Patient Representative;**19,21**;07/25/1995;Build 5
     1QACVEMPX ; Return Person Data using Value List Handler Pattern to update Patient Advocate PatsPerson table ;5/8/06  10:36
     2 ;;2.0;Patient Representative;**19**;07/25/1995;Build 55
    33EN(PATSBY,LKUPVAL,PATSROWS,PATSFRM0,PATSFRM1)        ; Lookup Employee by Name, then
    44 ; Output XML formatted data from NEW PERSON file.
     
    77 ;         an array of Security Keys.
    88 ; PATSROWS=Number of rows to return in each call
    9  ; PATSFRM0=Employee Name value from previous call (empty on first call, pass by ref)
    10  ; PATSFRM1=Employee IEN from previous call (empty on first call, pass by ref)
     9 ; PATSFRM0=Employee Name value from previous call (empty on first call)
     10 ; PATSFRM1=Employee IEN from previous call (empty on first call)
    1111 K ^TMP("DILIST",$J),^TMP("PatsPersonXml",$J)
    12  N STDNAME,ULASTNM,NAMECOMP,IENS,PIECE,OUTCNT,TAGLIST,FROM,PART,SRVIEN,MAILCODE,TITLE,SRVRSTA,PATSMORE,PATSERR,DIERR,I,J,X,Y
    13  ; If LKUPVAL exists, it contains an employee name, find partial matches.
    14  I $G(LKUPVAL)]"" D
    15  . S ULASTNM=$P(LKUPVAL,",")
    16  . D LOOKUP1
    17  . I (ULASTNM[" ")!(ULASTNM["'") D LOOKUP2
    18  . Q
    19  ; Else, it contains an array of Security Key values, find all
    20  ; holders of those keys.
     12 N STDNAME,NAMECOMP,IENS,PIECE,OUTCNT,TAGLIST,FROM,PART,SRVIEN,MAILCODE,TITLE,SRVRSTA,PATSMORE,PATSERR,DIERR,I,J,X,Y
     13 ; If LKUPVAL exists, it contains an employee name. Else, it is
     14 ;  an array of Security Key values and we want to find all holders
     15 ;  of those keys.
     16 ; Standardize the name, parse out last name and first name.
     17 I $G(LKUPVAL)]"" S STDNAME=LKUPVAL D BYNAME
    2118 I $G(LKUPVAL)="" D
    2219 . D EN^QACVKHLD(.LKUPVAL,PATSROWS,.PATSFRM0,.PATSFRM1)
     
    3734 ;
    3835 ;
    39 LOOKUP1 ; Use current routine to standardize the name (IA #3065)
    40  ; (name may contain spaces or apostrophes).
    41  S STDNAME=LKUPVAL
    42  I '$G(PATSROWS) S PATSROWS=10
    43  S PATSMORE=0
    44  I STDNAME["," S STDNAME=$$FORMAT^XLFNAME7(.STDNAME,1,35,,,,,1)
    45  E  S STDNAME=$$FORMAT^XLFNAME7(.STDNAME,1,35,,0,,1,1)
    46  ; If we've already found all matches to current standard, get out.
    47  N QOUT S QOUT=0
    48  I (ULASTNM[" ")!(ULASTNM["'") D  Q:QOUT
    49  . S X=$P($G(PATSFRM0),",")
    50  . Q:X=""
    51  . I (X[" ")!(X["'") Q
    52  . S QOUT=1 Q
    53  ; Get list of matching names.
    54  D GETLIST(STDNAME,PATSROWS,.PATSFRM0,.PATSFRM1,.PATSMORE,.FROM)
    55  Q
    56 LOOKUP2 ; Use old routine to standardize the name (no punctuation
    57  ; except hyphens).)
    58  ; Quit if the maximum number of names has been found.
    59  Q:PATSMORE
    60  ; Convert user input using old standardization routine
    61  S STDNAME=LKUPVAL
     36BYNAME ; Standardize the name, parse out last name and first name. (IA #3065)
    6237 D STDNAME^XLFNAME(.STDNAME,"FG")
    63  ; Find enough names to fill the list
    64  N NEWROWS
    65  S NEWROWS=PATSROWS-$P($G(^TMP("DILIST",$J,0)),"^")
    66  ; If list is already full, see whether there are more names
    67  ; using the old standardization, then quit.
    68  I NEWROWS'>0 D  Q
    69  . I $D(^VA(200,"B",STDNAME)) S NEWROWS=1
    70  . E  S X=$O(^VA(200,"B",STDNAME)) I $E(X,1,$L(STDNAME))=STDNAME S NEWROWS=1
    71  . I NEWROWS=1 S PATSMORE=1,FROM(1)=STDNAME,FROM(2)=""
    72  . Q
    73  ; Save off names found using current name standardization.
    74  K ^TMP("QACOLD",$J)
    75  I $D(^TMP("DILIST",$J)) D
    76  . M ^TMP("QACOLD",$J)=^TMP("DILIST",$J)
    77  . K ^TMP("QACOLD",$J,0) Q
    78  K ^TMP("DILIST",$J)
    79  ; Get new list of matching names.
    80  D GETLIST(STDNAME,NEWROWS,.PATSFRM0,.PATSFRM1,.PATSMORE,.FROM)
    81  ; Merge the two lists into ^TMP("DILIST",$J).
    82  S I=$O(^TMP("QACOLD",$J,PATSROWS+1),-1)
    83  I I D
    84  . S X=$P($G(^TMP("DILIST",$J,0)),"^")
    85  . I X F J=1:1:X I $D(^TMP("DILIST",$J,J,0)) S ^TMP("QACOLD",$J,(I+J),0)=^TMP("DILIST",$J,J,0) K ^TMP("DILIST",$J,J,0)
    86  . M ^TMP("DILIST",$J)=^TMP("QACOLD",$J)
    87  . S $P(^TMP("DILIST",$J,0),"^")=X+I
    88  . K ^TMP("QACOLD",$J)
    89  . Q
    90  Q
    91 GETLIST(STDNAME,PATSROWS,PATSFRM0,PATSFRM1,PATSMORE,FROM) ; Get a list of names matching STDNAME
    9238 N FIRST,LAST,LEN,SCR,CURRDT
    9339 S LAST=$P(STDNAME,","),FIRST=$P(STDNAME,",",2,99)
     
    10147 E  S FROM(1)=PATSFRM0,FROM(2)=$G(PATSFRM1)
    10248 S PART(1)=LAST
     49 I '$G(PATSROWS) S PATSROWS=10
    10350 ; Return list of standard name pointer, title and mail code (IA #10060)
    10451 D LIST^DIC(200,,"@;8;28","MP",PATSROWS,.FROM,.PART,"B",SCR)
     
    12168 . S ^TMP("PatsPersonXml",$J,OUTCNT)="<PatsPerson>"
    12269 . S IENS=$P(X,"^") Q:IENS=""  S IENS=IENS_","
    123  . ; NOTE: removes reserved XML characters (see $$SYMENC^MXMLUTL, IA#4153)
    124  . S TITLE=$$SYMENC^MXMLUTL($E($P(X,"^",2),1,30))
    125  . S MAILCODE=$$SYMENC^MXMLUTL($E($P(X,"^",3),1,30))
     70 . ; NOTE: does not remove reserved XML characters (see $$SYMENC^MXMLUTL, IA#4153)
     71 . S TITLE=$E($P(X,"^",2),1,30)
     72 . S MAILCODE=$E($P(X,"^",3),1,30)
    12673 . ; Get the individual name components and add them to the output (IA #3065)
    127  . K NAMECOMP
    128  . S NAMECOMP=$P($G(^VA(200,+IENS,0)),"^")
    129  . ; If name contains apostrophes or spaces, use current standardization
    130  . I ($P(NAMECOMP,",")["'")!($P(NAMECOMP,",")[" ") D
    131  .. S NAMECOMP=$$FORMAT^XLFNAME7(.NAMECOMP,1,35,,,,,2)
    132  .. S NAMECOMP=NAMECOMP("FAMILY")_"^"_NAMECOMP("GIVEN")_"^"_NAMECOMP("MIDDLE")_"^"_NAMECOMP("SUFFIX")
    133  .. Q
    134  . ; Else, use old standardization routine.
    135  . E  D
    136  .. K NAMECOMP S NAMECOMP("FILE")=200,NAMECOMP("FIELD")=.01,NAMECOMP("IENS")=IENS
    137  .. S NAMECOMP=$$HLNAME^XLFNAME(.NAMECOMP,"S")
     74 . K NAMECOMP S NAMECOMP("FILE")=200,NAMECOMP("FIELD")=.01,NAMECOMP("IENS")=IENS
     75 . S NAMECOMP=$$HLNAME^XLFNAME(.NAMECOMP,"S")
    13876 . F J=1:1:6 D
    13977 .. S OUTCNT=OUTCNT+1
Note: See TracChangeset for help on using the changeset viewer.