Changeset 355 for ccr/trunk


Ignore:
Timestamp:
Feb 3, 2009, 5:36:00 PM (16 years ago)
Author:
George Lilly
Message:

immune codes for RPMS

File:
1 edited

Legend:

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

    r354 r355  
    2828 D EXTRACT(IPXML,DFN,OUTXML) ;EXTRACT THE VARIABLES
    2929 N C0CZI,C0CZIC ; COUNT OF IMMUNIZATIONS
    30  S C0CZIC=@C0CZV@(0) ; TOTAL FROM VARIABLE ARRAY
    31  F C0CZI=1:1:C0CZIC D  ;FOR EACH IMMUNIZATION
    32  . S C0CZVI=$NA(@C0CZV@(C0CZI)) ;THIS IMMUNIZATION
    33  . D MAP^GPLXPATH(IPXML,C0CZVI,"C0CZT") ;MAP THE VARIABLES TO XML
    34  . I C0CZI=1 D  ; FIRST ONE
    35  . . D CP^GPLXPATH("C0CZT",OUTXML) ;JUST COPY RESULTS
    36  . E  D  ;NOT THE FIRST
    37  . . D INSINNER^GPLXPATH(OUTXML,"C0CZT")
     30 S C0CZIC=$G(@C0CZV@(0)) ; TOTAL FROM VARIABLE ARRAY
     31 I C0CZIC>0 D  ;IMMUNIZATIONS FOUND
     32 . F C0CZI=1:1:C0CZIC D  ;FOR EACH IMMUNIZATION
     33 . . S C0CZVI=$NA(@C0CZV@(C0CZI)) ;THIS IMMUNIZATION
     34 . . D MAP^GPLXPATH(IPXML,C0CZVI,"C0CZT") ;MAP THE VARIABLES TO XML
     35 . . I C0CZI=1 D  ; FIRST ONE
     36 . . . D CP^GPLXPATH("C0CZT",OUTXML) ;JUST COPY RESULTS
     37 . . E  D  ;NOT THE FIRST
     38 . . . D INSINNER^GPLXPATH(OUTXML,"C0CZT")
     39 E  S @OUTXML@(0)=0 ; SIGNAL NO IMMUNIZATIONS
    3840 Q
    3941 ;
     
    6971 . F  S C0CIMD=$O(@IMMA@(C0CIM,C0CIMD)) Q:C0CIMD=""  D  ; FOR EACH DATE
    7072 . . S C0CIEN=$O(@IMMA@(C0CIM,C0CIMD,"")) ;IEN OF IMMUNE RECORD
    71  . . D GETN^C0CRNF("C0CI",9000010.11,C0CIEN) ; GET THE FILEMAN RECORD TO PULL IENS
     73 . . D GETN^C0CRNF("C0CI",9000010.11,C0CIEN) ; GET THE FILEMAN RECORD FOR IENS
    7274 . . W C0CIEN,"_",C0CIMD
    7375 . . S C0CT=$$FMDTOUTC^CCRUTIL(9999999-C0CIMD,"DT") ; FORMAT DATE/TIME
     
    7981 . . S @VMAP@("IMMUNESOURCEACTORID")="ACTORPROVIDER_"_C0CIP
    8082 . . S C0CIIEN=$$ZVALUEI^C0CRNF("IMMUNIZATION","C0CI") ;IEN OF IMMUNIZATION
    81  . . ; FOR LOOKING UP THE CODE (TBD GPL)
    82  . . S C0CIN=$$ZVALUE^C0CRNF("IMMUNIZATION","C0CI") ;NAME OF IMMUNIZATION
    83  . . ; GET IT FROM THE CODE FILE CHANGE THIS (TBD GPL)
    84  . . S @VMAP@("IMMUNEPRODUCTNAMETEXT")=C0CIN ;NAME
    85  . . S @VMAP@("IMMUNEPRODUCTCODE")="" ;FIX THIS
    86  . . S @VMAP@("IMMUNEPRODUCTCODESYSTEM")="" ;FIX THIS
    87  Q
    88  . S VMAP=$NA(@TVMAP@(J))
    89  . K @VMAP
    90  . I DEBUG W "VMAP= ",VMAP,!
    91  . S PTMP=RPCRSLT(J) ; PULL OUT PROBLEM FROM RPC RETURN ARRAY
    92  . S @VMAP@("PROBLEMOBJECTID")="PROBLEM"_J ; UNIQUE OBJID FOR PROBLEM
    93  . S @VMAP@("PROBLEMIEN")=$P(PTMP,U,1)
    94  . S @VMAP@("PROBLEMSTATUS")=$S($P(PTMP,U,2)="A":"Active",1:"")
    95  . S @VMAP@("PROBLEMDESCRIPTION")=$P(PTMP,U,3)
    96  . S @VMAP@("PROBLEMCODINGVERSION")=""
    97  . S @VMAP@("PROBLEMCODEVALUE")=$P(PTMP,U,4)
    98  . S @VMAP@("PROBLEMDATEOFONSET")=$$FMDTOUTC^CCRUTIL($P(PTMP,U,5),"DT")
    99  . S @VMAP@("PROBLEMDATEMOD")=$$FMDTOUTC^CCRUTIL($P(PTMP,U,6),"DT")
    100  . S @VMAP@("PROBLEMSC")=$P(PTMP,U,7)
    101  . S @VMAP@("PROBLEMSE")=$P(PTMP,U,8)
    102  . S @VMAP@("PROBLEMCONDITION")=$P(PTMP,U,9)
    103  . S @VMAP@("PROBLEMLOC")=$P(PTMP,U,10)
    104  . S @VMAP@("PROBLEMLOCTYPE")=$P(PTMP,U,11)
    105  . S @VMAP@("PROBLEMPROVIDER")=$P(PTMP,U,12)
    106  . S X=@VMAP@("PROBLEMPROVIDER") ; FORMAT Y;NAME Y IS IEN OF PROVIDER
    107  . S @VMAP@("PROBLEMSOURCEACTORID")="ACTORPROVIDER_"_$P(X,";",1)
    108  . S @VMAP@("PROBLEMSERVICE")=$P(PTMP,U,13)
    109  . S @VMAP@("PROBLEMHASCMT")=$P(PTMP,U,14)
    110  . S @VMAP@("PROBLEMDTREC")=$$FMDTOUTC^CCRUTIL($P(PTMP,U,15),"DT")
    111  . S @VMAP@("PROBLEMINACT")=$$FMDTOUTC^CCRUTIL($P(PTMP,U,16),"DT")
    112  . S ARYTMP=$NA(@TARYTMP@(J))
    113  . ; W "ARYTMP= ",ARYTMP,!
    114  . K @ARYTMP
    115  . D MAP^GPLXPATH(IPXML,VMAP,ARYTMP) ;
    116  . I J=1 D  ; FIRST ONE IS JUST A COPY
    117  . . ; W "FIRST ONE",!
    118  . . D CP^GPLXPATH(ARYTMP,OUTXML)
    119  . . ; W "OUTXML ",OUTXML,!
    120  . I J>1 D  ; AFTER THE FIRST, INSERT INNER XML
    121  . . D INSINNER^GPLXPATH(OUTXML,ARYTMP)
    122  ; ZWR ^TMP("GPLCCR",$J,"PROBVALS",*)
    123  ; ZWR ^TMP("GPLCCR",$J,"PROBARYTMP",*) ; SHOW THE RESULTS
    124  ; ZWR @OUTXML
    125  ; $$HTML^DILF(
    126  ; GENERATE THE NARITIVE HTML FOR THE CCD
    127  I CCD D  ; IF THIS IS FOR A CCD
    128  . N HTMP,HOUT,HTMLO,GPLPROBI,ZX
    129  . F GPLPROBI=1:1:RPCRSLT(0) D  ; FOR EACH PROBLEM
    130  . . S VMAP=$NA(@TVMAP@(GPLPROBI))
    131  . . I DEBUG W "VMAP =",VMAP,!
    132  . . D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Body/PROBLEMS-HTML","HTMP") ; GET THE HTML FROM THE TEMPLATE
    133  . . D UNMARK^GPLXPATH("HTMP") ; REMOVE <PROBLEMS-HTML> MARKUP
    134  . . ; D PARY^GPLXPATH("HTMP") ; PRINT IT
    135  . . D MAP^GPLXPATH("HTMP",VMAP,"HOUT") ; MAP THE VARIABLES
    136  . . ; D PARY^GPLXPATH("HOUT") ; PRINT IT AGAIN
    137  . . I GPLPROBI=1 D  ; FIRST ONE IS JUST A COPY
    138  . . . D CP^GPLXPATH("HOUT","HTMLO")
    139  . . I GPLPROBI>1 D  ; AFTER THE FIRST, INSERT INNER HTML
    140  . . . I DEBUG W "DOING INNER",!
    141  . . . N HTMLBLD,HTMLTMP
    142  . . . D QUEUE^GPLXPATH("HTMLBLD","HTMLO",1,HTMLO(0)-1)
    143  . . . D QUEUE^GPLXPATH("HTMLBLD","HOUT",2,HOUT(0)-1)
    144  . . . D QUEUE^GPLXPATH("HTMLBLD","HTMLO",HTMLO(0),HTMLO(0))
    145  . . . D BUILD^GPLXPATH("HTMLBLD","HTMLTMP")
    146  . . . D CP^GPLXPATH("HTMLTMP","HTMLO")
    147  . . . ; D INSINNER^GPLXPATH("HOUT","HTMLO","//")
    148  . I DEBUG D PARY^GPLXPATH("HTMLO")
    149  . D INSB4^GPLXPATH(OUTXML,"HTMLO") ; INSERT AT TOP OF SECTION
    150  N PROBSTMP,I
    151  D MISSING^GPLXPATH(ARYTMP,"PROBSTMP") ; SEARCH XML FOR MISSING VARS
    152  I PROBSTMP(0)>0  D  ; IF THERE ARE MISSING VARS -
     83 . . I $G(DUZ("AG"))="I" D  ; RUNNING IN RPMS
     84 . . . D GETN^C0CRNF("C0CZIM",9999999.14,C0CIIEN) ;GET IMMUNE RECORD
     85 . . . S C0CIN=$$ZVALUE^C0CRNF("NAME","C0CZIM") ; USE NAME IN IMMUNE RECORD
     86 . . . ; FOR LOOKING UP THE CODE
     87 . . . ; GET IT FROM THE CODE FILE
     88 . . . S C0CICD=$$ZVALUE^C0CRNF("HL7-CVX CODE","C0CZIM") ;CVX CODE
     89 . . . S @VMAP@("IMMUNEPRODUCTNAMETEXT")=C0CIN ;NAME
     90 . . . S @VMAP@("IMMUNEPRODUCTCODE")=C0CICD ; CVX CODE
     91 . . . I C0CICD'="" S @VMAP@("IMMUNEPRODUCTCODESYSTEM")="CDC Vaccine Code" ;
     92 . . . E  S @VMAP@("IMMUNEPRODUCTCODESYSTEM")="" ;NULL
     93 . . E  D  ; NOT IN RPMS
     94 . . . S C0CIN=$$ZVALUE^C0CRNF("IMMUNIZATION","C0CI") ;NAME OF IMMUNIZATION
     95 . . . S @VMAP@("IMMUNEPRODUCTNAMETEXT")=C0CIN ;NAME
     96 . . . S @VMAP@("IMMUNEPRODUCTCODE")="" ; CVX CODE
     97 . . . S @VMAP@("IMMUNEPRODUCTCODESYSTEM")="" ;NO CODE
     98 N IMMUTMP,I
     99 D MISSING^GPLXPATH(ARYTMP,"IMMUTMP") ; SEARCH XML FOR MISSING VARS
     100 I IMMUTMP(0)>0  D  ; IF THERE ARE MISSING VARS -
    153101 . ; STRINGS MARKED AS @@X@@
    154  . W !,"PROBLEMS Missing list: ",!
    155  . F I=1:1:PROBSTMP(0) W PROBSTMP(I),!
     102 . W !,"IMMUNE Missing list: ",!
     103 . F I=1:1:IMMUTMP(0) W IMMUTMP(I),!
    156104 Q
    157105 ;
Note: See TracChangeset for help on using the changeset viewer.