Changeset 31 for ccr/trunk/p


Ignore:
Timestamp:
Jul 1, 2008, 5:20:10 PM (16 years ago)
Author:
George Lilly
Message:

Created actor records P1=OBJID P2=TYPE P3=IEN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/GPLCCR.m

    r30 r31  
    1010        S DFN=$P(Y,U,1) ; SET THE PATIENT
    1111        N CCRGLO
    12         D CCRRPC(.CCRGLO,DFN,"CCR")
     12        D CCRRPC(.CCRGLO,DFN,"CCR","","","")
    1313        S OARY=$NA(^TMP($J,DFN,"CCR",1))
    1414        S ONAM="PAT_"_DFN_"_CCR_V1.xml"
     
    1717        Q
    1818        ;
    19 CCRRPC(CCRGRTN,DFN,CCRPART) ; RPC ENTRY POINT FOR CCR OUTPUT
     19CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ; RPC ENTRY POINT FOR CCR OUTPUT
     20        ; CCRGRTN IS RETURN ARRAY PASSED BY NAME
     21        ; DFN IS PATIENT IEN
     22        ; CCRPART IS "CCR" FOR ENTIRE CCR, OR SECTION NAME FOR A PART OF THE
     23        ;        CCR BODY.. PARTS INCLUDE "PROBLEMS" "VITALS" ETC
     24        ; TIME1 IS STARTING TIME TO INCLUDE - NULL MEANS ALL
     25        ; TIME2 IS ENDING TIME TO INCLUDE TIME IS FILEMAN TIME - NULL MEANS NOW
     26        ; HDRARY IS THE HEADER ARRAY DEFINING THE "FROM" AND "TO" VARIABLES
     27        ;    IF NULL WILL DEFAULT TO "FROM" DUZ AND "TO" DFN
    2028        S DEBUG=0
    2129        S TGLOBAL=$NA(^TMP($J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
     
    3442        I DEBUG F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),!
    3543        ;
    36         D CCRHDR(CCRGLO,DFN) ; MAP HEADER VARIABLES
     44        D HDRMAP(CCRGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
     45        ;
    3746        S CCRXTAB="^TMP($J,""CCRSTEP"")" ; GLOBAL TO STORE CCR PROCESSING STEPS
    3847        D INITSTPS(CCRXTAB) ; INITIALIZED CCR PROCESSING STEPS
     
    6372        Q
    6473         ;
    65 CCRHDR(CXML,DFN) ; MAP HEADER VARIABLES: FROM, TO ECT
     74HDRMAP(CXML,DFN,IHDR) ; MAP HEADER VARIABLES: FROM, TO ECT
    6675        N VMAP S VMAP=$NA(^TMP($J,DFN,"HEADER"))
    6776        ; K @VMAP
    68         S @VMAP@("ACTORPATIENT")="ACTORPATIENT_"_DFN
    69         S @VMAP@("ACTORFROM")="ACTORPROVIDER_"_DUZ ; FROM DUZ - ???
    70         S @VMAP@("ACTORFROM2")="ACTORPROVIDER_"_DUZ ; NEED A BETTER WAY
    71         S @VMAP@("ACTORTO")="ACTORPATIENT_"_DFN  ; FOR TEST PURPOSES,
    72         ; THIS IS THE USE CASE FOR THE PHR WHERE "TO" IS THE PATIENT
     77        I IHDR="" D  ; HEADER ARRAY IS NOT PROVIDED, USE DEFAULTS
     78        . S @VMAP@("ACTORPATIENT")="ACTORPATIENT_"_DFN
     79        . S @VMAP@("ACTORFROM")="ACTORPROVIDER_"_DUZ ; FROM DUZ - ???
     80        . S @VMAP@("ACTORFROM2")="ACTORPROVIDER_"_DUZ ; NEED A BETTER WAY
     81        . S @VMAP@("ACTORTO")="ACTORPATIENT_"_DFN  ; FOR TEST PURPOSES,
     82        . ; THIS IS THE USE CASE FOR THE PHR WHERE "TO" IS THE PATIENT
     83        I IHDR'="" D  ; HEADER VALUES ARE PROVIDED
     84        . D CP^GPLXPATH(IHDR,VMAP) ; COPY HEADER VARIABLES TO MAP ARRAY
    7385        N CTMP
    7486        D MAP^GPLXPATH(CXML,VMAP,"CTMP")
     
    7890ACTLST(AXML,ACTRTN) ; RETURN THE ACTOR LIST FOR THE XML IN AXML
    7991        ; AXML AND ACTRTN ARE PASSED BY NAME
    80         N I,J,K
     92        ; EACH ACTOR RECORD HAS 3 PARTS - IE IF OBJECTID=ACTORPATIENT_2
     93        ; P1= OBJECTID - ACTORPATIENT_2
     94        ; P2= OBJECT TYPE - PATIENT OR PROVIDER
     95        ; P3= IEN RECORD NUMBER FOR ACTOR - 2
     96        N I,J,K,L
    8197        K @ACTRTN ; CLEAR RETURN ARRAY
    8298        F I=1:1:@AXML@(0) D  ; SCAN ALL LINES
     
    84100        . . S J=$P($P(@AXML@(I),"<ActorID>",2),"</ActorID>",1)
    85101        . . W "<ActorID>=>",J,!
    86         . . S K(J)="" ; HASHING ACTOR TO GET RID OF MULTIPLES
     102        . . S K(J)="" ; HASHING ACTOR TO GET RID OF DUPLICATES
    87103        S I="" ; GOING TO $O THROUGH THE HASH
    88104        F J=0:0 D  Q:$O(K(I))=""
    89105        . S I=$O(K(I)) ; WALK THROUGH THE HASH OF ACTORS
    90         . D PUSH^GPLXPATH(ACTRTN,I) ; ADD THE ACTOR TO THE RETURN ARRAY
     106        . S $P(L,U,1)=I ; FIRST PIECE IS THE OBJECT ID
     107        . S $P(L,U,2)=$P($P(I,"ACTOR",2),"_",1) ; ACTOR TYPE: PATIENT/PROVIDER
     108        . S $P(L,U,3)=$P(I,"_",2) ; IEN RECORD NUMBER FOR ACTOR
     109        . D PUSH^GPLXPATH(ACTRTN,L) ; ADD THE ACTOR TO THE RETURN ARRAY
    91110        Q
    92111        ;
Note: See TracChangeset for help on using the changeset viewer.