Changeset 155 for ccr/trunk


Ignore:
Timestamp:
Sep 21, 2008, 5:10:51 PM (16 years ago)
Author:
George Lilly
Message:

added DPATVGPLRIMA and supporting routines to display patient variables

Location:
ccr/trunk/p
Files:
3 edited

Legend:

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

    r148 r155  
    365365    Q
    366366    ;
     367RPCGV(RTN,DFN,WHICH) ; RPC GET VARS
     368    ; RETURNS IN RTN (PASSED BY REFERENCE) THE VARS AND VALUES
     369    ; FOUND AT INARY RTN(X)="VAR^VALUE" RTN(0) IS THE COUNT
     370    ; DFN IS THE PATIENT NUMBER.
     371    ; WHICH IS "ALL" OR "MEDS" OR "VITALS" OR "PROBLEMS" OR "ALERTS" OR "LABS"
     372    ; OR OTHER SECTIONS AS THEY ARE ADDED
     373    ; THIS IS MEANT TO BE AVAILABLE AS AN RPC
     374    I '$D(RIMBASE) D ASETUP ; FOR COMMAND LINE CALLS
     375    S ZVBASE=$NA(@RIMBASE@("VARS")) ; BASE OF VARIABLES
     376    S RTN(0)=0 ; DEFAULT NOTHING IS RETURNED
     377    N ZZGI
     378    I WHICH="ALL" D  ; VARIABLES FROM ALL SECTIONS
     379    . F ZZGI="PROBLEMS","VITALS","MEDS" D  ; FOR EACH SECTION
     380    . . D ZGVWRK(ZZGI) ; DO EACH SECTION
     381    E  D ZGVWRK(WHICH) ; ONLY ONE SECTION ASKED FOR
     382    Q
     383    ;
     384ZGVWRK(ZWHICH) ; DO ONE SECTION FOR RPCGV
     385    ;
     386    N ZZGN ; NAME FOR SECTION VARIABLES
     387    S ZZGN=$NA(@ZVBASE@(DFN,ZWHICH)) ; BASE OF VARS FOR SECTION
     388    I '$D(@ZZGN@(0)) Q ; NO VARS FOR THIS SECTION
     389    E  D  ; VARS EXIST
     390    . N ZGVI
     391    . F ZGVI=1:1:@ZZGN@(0) D  ; FOR EACH MULTIPLE IN SECTION
     392    . . K ZZGA N ZZGA ; TEMP ARRAY FOR SECTION VARS
     393    . . K ZZGN2 N ZZGN2 ; NAME FOR MULTIPLE
     394    . . S ZZGN2=$NA(@ZZGN@(ZGVI))
     395    . . ; W ZZGN2,!,$O(@ZZGN2@("")),!
     396    . . D H2ARY^GPLXPATH("ZZGA",ZZGN2) ; CONVERT HASH TO ARRAY
     397    . . ; D PARY^GPLXPATH("ZZGA")
     398    . . D PUSHA^GPLXPATH("RTN","ZZGA") ; PUSH ARRAY INTO RETURN
     399    Q
     400    ;
     401DPATV(DFN,IWHICH) ; DISPLAY VARS FOR PATIENT DFN THAT ARE MAINTAINED IN GPLRIM
     402    ; ALONG WITH SAMPLE VALUES.
     403    ; IWHICH IS "ALL" OR "MEDS" OR "VITALS" OR "PROBLEMS" OR "ALERTS" OR "LABS"
     404    N GTMP
     405    D RPCGV(.GTMP,DFN,IWHICH)
     406    D PARY^GPLXPATH("GTMP")
     407    Q
     408    ;
  • ccr/trunk/p/GPLXPAT0.m

    r124 r155  
    190190 ;;>>>D INSINNER^GPLXPATH("G2","G2")
    191191 ;;>>?G2(8)="<FIFTH>"
     192 ;;><PUSHA>
     193 ;;>>>K GTMP,GTMP2
     194 ;;>>>N GTMP,GTMP2
     195 ;;>>>D PUSH^GPLXPATH("GTMP","A")
     196 ;;>>>D PUSH^GPLXPATH("GTMP2","B")
     197 ;;>>>D PUSH^GPLXPATH("GTMP2","C")
     198 ;;>>>D PUSHA^GPLXPATH("GTMP","GTMP2")
     199 ;;>>?GTMP(3)="C"
     200 ;;>>?GTMP(0)=3
     201 ;;><H2ARY>
     202 ;;>>>K GTMP,GTMP2
     203 ;;>>>S GTMP("TEST1")=1
     204 ;;>>>D H2ARY^GPLXPATH("GTMP2","GTMP")
     205 ;;>>?GTMP2(0)=1
     206 ;;>>?GTMP2(1)="TEST1^1"
    192207 ;;></TEST>
  • ccr/trunk/p/GPLXPATH.m

    r149 r155  
    5050 Q
    5151 ;
     52PUSHA(ADEST,ASRC) ; PUSH ASRC ONTO ADEST, BOTH PASSED BY NAME
     53 ;
     54 N ZGI
     55 F ZGI=1:1:@ASRC@(0) D  ; FOR ALL OF THE SOURCE ARRAY
     56 . D PUSH(ADEST,@ASRC@(ZGI)) ; PUSH ONE ELEMENT
     57 Q
     58 ;
    5259MKMDX(STK,RTN)  ; MAKES A MUMPS INDEX FROM THE ARRAY STK
    53  ; RTN IS SET TO //FIRST/SECOND/THIRD" FOR THREE ARRAY ELEMENTS
     60 ; RTN IS SET TO //FIRST/SECOND/THIRD FOR THREE ARRAY ELEMENTS
    5461 S RTN=""
    5562 N I
     
    420427 Q
    421428 ;
     429H2ARY(IARYRTN,IHASH) ; CONVERT IHASH TO RETURN ARRAY
     430 ;
     431 N H2I S H2I=""
     432 ; W $O(@IHASH@(H2I)),!
     433 F  S H2I=$O(@IHASH@(H2I)) Q:H2I=""  D  ; FOR EACH ELEMENT OF THE HASH
     434 . ; W H2I_"^"_@IHASH@(H2I),!
     435 . D PUSH(IARYRTN,H2I_"^"_@IHASH@(H2I))
     436 . ; W @IARYRTN@(0),!
     437 Q
     438 ;
    422439TEST     ; Run all the test cases
    423440 D TESTALL^GPLUNIT("GPLXPAT0")
Note: See TracChangeset for help on using the changeset viewer.