Changeset 391 for ccr/trunk/p


Ignore:
Timestamp:
Mar 14, 2009, 6:23:22 PM (16 years ago)
Author:
George Lilly
Message:

name spacing the package to C0C ... removing all GPL references

Location:
ccr/trunk/p
Files:
13 added
13 deleted
1 edited

Legend:

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

    r134 r391  
    1 GPLCCD   ; CCDCCR/GPL - CCD MAIN PROCESSING; 6/6/08
     1C0CCCD   ; CCDCCR/GPL - CCD MAIN PROCESSING; 6/6/08
    22 ;;0.1;CCDCCR;nopatch;noreleasedate
    3  ;Copyright 2008 WorldVistA.  Licensed under the terms of the GNU
    4  ;General Public License See attached copy of the License.
     3 ;Copyright 2008,2009 George Lilly, University of Minnesota.
     4 ;Licensed under the terms of the GNU General Public License.
     5 ;See attached copy of the License.
    56 ;
    67 ;This program is free software; you can redistribute it and/or modify
     
    2930       ;
    3031XPAT(DFN,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
    31        ; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("GPLCCR","ODIR")
     32       ; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("C0CCCR","ODIR")
    3233       ; FN IS FILE NAME, DEFAULTS IF NULL
    3334       ; N CCDGLO
    3435       D CCDRPC(.CCDGLO,DFN,"CCD","","","")
    35        S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCD",1))
     36       S OARY=$NA(^TMP("C0CCCR",$J,DFN,"CCD",1))
    3637       S ONAM=FN
    3738       I FN="" S ONAM="PAT_"_DFN_"_CCD_V1.xml"
    38        S ODIRGLB=$NA(^TMP("GPLCCR","ODIR"))
     39       S ODIRGLB=$NA(^TMP("C0CCCR","ODIR"))
    3940       I '$D(@ODIRGLB) D  ; IF NOT ODIR HAS BEEN SET
    4041       . S @ODIRGLB="/home/glilly/CCROUT"
     
    4445       I DIR="" S ODIR=@ODIRGLB
    4546       N ZY
    46        S ZY=$$OUTPUT^GPLXPATH(OARY,ONAM,ODIR)
     47       S ZY=$$OUTPUT^C0CXPATH(OARY,ONAM,ODIR)
    4748       W $P(ZY,U,2)
    4849       Q
     
    6263    N CCD S CCD=0 ; FLAG FOR PROCESSING A CCD
    6364    I CCRPART="CCD" S CCD=1 ; WE ARE PROCESSING A CCD
    64     S TGLOBAL=$NA(^TMP("GPLCCR",$J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
    65     I CCD S CCDGLO=$NA(^TMP("GPLCCR",$J,DFN,"CCD")) ; GLOBAL FOR THE CCD
    66     E  S CCDGLO=$NA(^TMP("GPLCCR",$J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
    67     S ACTGLO=$NA(^TMP("GPLCCR",$J,DFN,"ACTORS")) ; GLOBAL FOR ALL ACTORS
     65    S TGLOBAL=$NA(^TMP("C0CCCR",$J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
     66    I CCD S CCDGLO=$NA(^TMP("C0CCCR",$J,DFN,"CCD")) ; GLOBAL FOR THE CCD
     67    E  S CCDGLO=$NA(^TMP("C0CCCR",$J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
     68    S ACTGLO=$NA(^TMP("C0CCCR",$J,DFN,"ACTORS")) ; GLOBAL FOR ALL ACTORS
    6869    ; TO GET PART OF THE CCR RETURNED, PASS CCRPART="PROBLEMS" ETC
    69     S CCRGRTN=$NA(^TMP("GPLCCR",$J,DFN,CCRPART)) ; RTN GLO NM OF PART OR ALL
    70     I CCD D LOAD^GPLCCD1(TGLOBAL)  ; LOAD THE CCR TEMPLATE
    71     E  D LOAD^GPLCCR0(TGLOBAL)  ; LOAD THE CCR TEMPLATE
    72     D CP^GPLXPATH(TGLOBAL,CCDGLO) ; COPY THE TEMPLATE TO CCR GLOBAL
     70    S CCRGRTN=$NA(^TMP("C0CCCR",$J,DFN,CCRPART)) ; RTN GLO NM OF PART OR ALL
     71    I CCD D LOAD^C0CCCD1(TGLOBAL)  ; LOAD THE CCR TEMPLATE
     72    E  D LOAD^C0CCCR0(TGLOBAL)  ; LOAD THE CCR TEMPLATE
     73    D CP^C0CXPATH(TGLOBAL,CCDGLO) ; COPY THE TEMPLATE TO CCR GLOBAL
    7374    N CAPSAVE,CAPSAVE2 ; FOR HOLDING THE CCD ROOT LINES
    7475    S CAPSAVE=@TGLOBAL@(3) ; SAVE THE CCD ROOT
     
    8182    ; DELETE THE BODY, ACTORS AND SIGNATURES SECTIONS FROM GLOBAL
    8283    ; THESE WILL BE POPULATED AFTER CALLS TO THE XPATH ROUTINES
    83     D REPLACE^GPLXPATH(CCDGLO,"","//ContinuityOfCareRecord/Body")
    84     D REPLACE^GPLXPATH(CCDGLO,"","//ContinuityOfCareRecord/Actors")
    85     I 'CCD D REPLACE^GPLXPATH(CCDGLO,"","//ContinuityOfCareRecord/Signatures")
     84    D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Body")
     85    D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Actors")
     86    I 'CCD D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Signatures")
    8687    I DEBUG F I=1:1:@CCDGLO@(0) W @CCDGLO@(I),!
    8788    ;
     
    8990    ; MAPPING THE PATIENT PORTION OF THE CDA HEADER
    9091    S ZZX="//ContinuityOfCareRecord/recordTarget/patientRole/patient"
    91     D QUERY^GPLXPATH(CCDGLO,ZZX,"ACTT1")
    92     D PATIENT^GPLACTOR("ACTT1",DFN,"ACTORPATIENT_"_DFN,"ACTT2") ; MAP PATIENT
    93     I DEBUG D PARY^GPLXPATH("ACTT2")
    94     D REPLACE^GPLXPATH(CCDGLO,"ACTT2",ZZX)
    95     I DEBUG D PARY^GPLXPATH(CCDGLO)
     92    D QUERY^C0CXPATH(CCDGLO,ZZX,"ACTT1")
     93    D PATIENT^C0CACTOR("ACTT1",DFN,"ACTORPATIENT_"_DFN,"ACTT2") ; MAP PATIENT
     94    I DEBUG D PARY^C0CXPATH("ACTT2")
     95    D REPLACE^C0CXPATH(CCDGLO,"ACTT2",ZZX)
     96    I DEBUG D PARY^C0CXPATH(CCDGLO)
    9697    K ACTT1 K ACCT2
    9798    ; MAPPING THE PROVIDER ORGANIZATION,AUTHOR,INFORMANT,CUSTODIAN CDA HEADER
    9899    ; FOR NOW, THEY ARE ALL THE SAME AND RESOLVE TO ORGANIZATION
    99     D ORG^GPLACTOR(CCDGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG
    100     D CP^GPLXPATH("ACTT2",CCDGLO)
    101     ;
    102     K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
    103     S CCRXTAB=$NA(^TMP("GPLCCR",$J,"CCRSTEP")) ; GLOBAL TO STORE CCR STEPS
     100    D ORG^C0CACTOR(CCDGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG
     101    D CP^C0CXPATH("ACTT2",CCDGLO)
     102    ;
     103    K ^TMP("C0CCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
     104    S CCRXTAB=$NA(^TMP("C0CCCR",$J,"CCRSTEP")) ; GLOBAL TO STORE CCR STEPS
    104105    D INITSTPS(CCRXTAB) ; INITIALIZED CCR PROCESSING STEPS
    105106    N I,XI,TAG,RTN,CALL,XPATH,IXML,OXML,INXML,CCRBLD
     
    109110    . S TAG=$P(XI,";",1) ; LABEL INSIDE ROUTINE TO CALL
    110111    . S XPATH=$P(XI,";",3) ; XPATH TO XML TO PASS TO ROUTINE
    111     . D QUERY^GPLXPATH(TGLOBAL,XPATH,"INXML") ; EXTRACT XML TO PASS
     112    . D QUERY^C0CXPATH(TGLOBAL,XPATH,"INXML") ; EXTRACT XML TO PASS
    112113    . S IXML="INXML"
    113114    . I CCD D SHAVE(IXML) ; REMOVE ALL BUT REPEATING PARTS OF TEMPLATE SECTION
     
    118119    . X CALL
    119120    . I @OXML@(0)'=0 D  ; THERE IS A RESULT
    120     . . I CCD D QUERY^GPLXPATH(TGLOBAL,XPATH,"ITMP") ; XML TO UNSHAVE WITH
     121    . . I CCD D QUERY^C0CXPATH(TGLOBAL,XPATH,"ITMP") ; XML TO UNSHAVE WITH
    121122    . . I CCD D UNSHAVE("ITMP",OXML)
    122     . . I CCD D UNMARK^GPLXPATH(OXML) ; REMOVE THE CCR MARKUP FROM SECTION
     123    . . I CCD D UNMARK^C0CXPATH(OXML) ; REMOVE THE CCR MARKUP FROM SECTION
    123124    . ; NOW INSERT THE RESULTS IN THE CCR BUFFER
    124     . D INSERT^GPLXPATH(CCDGLO,OXML,"//ContinuityOfCareRecord/Body")
    125     . I DEBUG F GPLI=1:1:@OXML@(0) W @OXML@(GPLI),!
     125    . D INSERT^C0CXPATH(CCDGLO,OXML,"//ContinuityOfCareRecord/Body")
     126    . I DEBUG F C0CI=1:1:@OXML@(0) W @OXML@(C0CI),!
    126127    ; NEED TO ADD BACK IN ACTOR PROCESSING AFTER WE FIGURE OUT LINKAGE
    127     ; D ACTLST^GPLCCR(CCDGLO,ACTGLO) ; GEN THE ACTOR LIST
    128     ; D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT")
    129     ; D EXTRACT^GPLACTOR("ACTT",ACTGLO,"ACTT2")
    130     ; D INSINNER^GPLXPATH(CCDGLO,"ACTT2","//ContinuityOfCareRecord/Actors")
     128    ; D ACTLST^C0CCCR(CCDGLO,ACTGLO) ; GEN THE ACTOR LIST
     129    ; D QUERY^C0CXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT")
     130    ; D EXTRACT^C0CACTOR("ACTT",ACTGLO,"ACTT2")
     131    ; D INSINNER^C0CXPATH(CCDGLO,"ACTT2","//ContinuityOfCareRecord/Actors")
    131132    N I,J,DONE S DONE=0
    132133    F I=0:0 D  Q:DONE  ; DELETE UNTIL ALL EMPTY ELEMENTS ARE GONE
    133     . S J=$$TRIM^GPLXPATH(CCDGLO) ; DELETE EMPTY ELEMENTS
     134    . S J=$$TRIM^C0CXPATH(CCDGLO) ; DELETE EMPTY ELEMENTS
    134135    . W "TRIMMED",J,!
    135136    . I J=0 S DONE=1 ; DONE WHEN TRIM RETURNS FALSE
     
    149150    W "TAB= ",TAB,!
    150151    ; ORDER FOR CCR IS PROBLEMS,FAMILYHISTORY,SOCIALHISTORY,MEDICATIONS,VITALSIGNS,RESULTS,HEALTHCAREPROVIDERS
    151     D PUSH^GPLXPATH(TAB,"EXTRACT;GPLPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP(""GPLCCR"",$J,DFN,""PROBLEMS"")")
    152     ;D PUSH^GPLXPATH(TAB,"EXTRACT;GPLMEDS;//ContinuityOfCareRecord/Body/Medications;^TMP(""GPLCCR"",$J,DFN,""MEDICATIONS"")")
    153     I 'CCD D PUSH^GPLXPATH(TAB,"EXTRACT;GPLVITAL;//ContinuityOfCareRecord/Body/VitalSigns;^TMP(""GPLCCR"",$J,DFN,""VITALS"")")
     152    D PUSH^C0CXPATH(TAB,"EXTRACT;C0CPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP(""C0CCCR"",$J,DFN,""PROBLEMS"")")
     153    ;D PUSH^C0CXPATH(TAB,"EXTRACT;C0CMEDS;//ContinuityOfCareRecord/Body/Medications;^TMP(""C0CCCR"",$J,DFN,""MEDICATIONS"")")
     154    I 'CCD D PUSH^C0CXPATH(TAB,"EXTRACT;C0CVITAL;//ContinuityOfCareRecord/Body/VitalSigns;^TMP(""C0CCCR"",$J,DFN,""VITALS"")")
    154155    Q
    155156    ;
     
    159160    W SHXML,!
    160161    W @SHXML@(1),!
    161     D QUEUE^GPLXPATH("SHBLD",SHXML,1,1) ; THE FIRST LINE IS NEEDED
    162     D QUEUE^GPLXPATH("SHBLD",SHXML,7,@SHXML@(0)-3) ; REPEATING PART
    163     D QUEUE^GPLXPATH("SHBLD",SHXML,@SHXML@(0),@SHXML@(0)) ; LAST LINE
    164     D PARY^GPLXPATH("SHBLD") ; PRINT BUILD LIST
    165     D BUILD^GPLXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
    166     D CP^GPLXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
     162    D QUEUE^C0CXPATH("SHBLD",SHXML,1,1) ; THE FIRST LINE IS NEEDED
     163    D QUEUE^C0CXPATH("SHBLD",SHXML,7,@SHXML@(0)-3) ; REPEATING PART
     164    D QUEUE^C0CXPATH("SHBLD",SHXML,@SHXML@(0),@SHXML@(0)) ; LAST LINE
     165    D PARY^C0CXPATH("SHBLD") ; PRINT BUILD LIST
     166    D BUILD^C0CXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
     167    D CP^C0CXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
    167168    Q
    168169    ;
     
    172173    W SHXML,!
    173174    W @SHXML@(1),!
    174     D QUEUE^GPLXPATH("SHBLD",ORIGXML,1,6) ; FIRST 6 LINES OF TEMPLATE
    175     D QUEUE^GPLXPATH("SHBLD",SHXML,2,@SHXML@(0)-1) ; INS ALL BUT FIRST/LAST
    176     D QUEUE^GPLXPATH("SHBLD",ORIGXML,@ORIGXML@(0)-2,@ORIGXML@(0)) ; FROM TEMP
    177     D PARY^GPLXPATH("SHBLD") ; PRINT BUILD LIST
    178     D BUILD^GPLXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
    179     D CP^GPLXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
     175    D QUEUE^C0CXPATH("SHBLD",ORIGXML,1,6) ; FIRST 6 LINES OF TEMPLATE
     176    D QUEUE^C0CXPATH("SHBLD",SHXML,2,@SHXML@(0)-1) ; INS ALL BUT FIRST/LAST
     177    D QUEUE^C0CXPATH("SHBLD",ORIGXML,@ORIGXML@(0)-2,@ORIGXML@(0)) ; FROM TEMP
     178    D PARY^C0CXPATH("SHBLD") ; PRINT BUILD LIST
     179    D BUILD^C0CXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
     180    D CP^C0CXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
    180181    Q
    181182    ;
    182183HDRMAP(CXML,DFN,IHDR)   ; MAP HEADER VARIABLES: FROM, TO ECT
    183     N VMAP S VMAP=$NA(^TMP("GPLCCR",$J,DFN,"HEADER"))
     184    N VMAP S VMAP=$NA(^TMP("C0CCCR",$J,DFN,"HEADER"))
    184185    ; K @VMAP
    185186    S @VMAP@("DATETIME")=$$FMDTOUTC^CCRUTIL($$NOW^XLFDT,"DT")
     
    193194    . ; THIS IS THE USE CASE FOR THE PHR WHERE "TO" IS THE PATIENT
    194195    I IHDR'="" D  ; HEADER VALUES ARE PROVIDED
    195     . D CP^GPLXPATH(IHDR,VMAP) ; COPY HEADER VARIABLES TO MAP ARRAY
     196    . D CP^C0CXPATH(IHDR,VMAP) ; COPY HEADER VARIABLES TO MAP ARRAY
    196197    N CTMP
    197     D MAP^GPLXPATH(CXML,VMAP,"CTMP")
    198     D CP^GPLXPATH("CTMP",CXML)
     198    D MAP^C0CXPATH(CXML,VMAP,"CTMP")
     199    D CP^C0CXPATH("CTMP",CXML)
    199200    Q
    200201    ;
     
    221222    . S $P(L,U,2)=$P($P(I,"ACTOR",2),"_",1) ; ACTOR TYPE
    222223    . S $P(L,U,3)=$P(I,"_",2) ; IEN RECORD NUMBER FOR ACTOR
    223     . D PUSH^GPLXPATH(ACTRTN,L) ; ADD THE ACTOR TO THE RETURN ARRAY
     224    . D PUSH^C0CXPATH(ACTRTN,L) ; ADD THE ACTOR TO THE RETURN ARRAY
    224225    Q
    225226    ;
    226227TEST ; RUN ALL THE TEST CASES
    227   D TESTALL^GPLUNIT("GPLCCR")
     228  D TESTALL^C0CUNIT("C0CCCR")
    228229  Q
    229230  ;
    230231ZTEST(WHICH)  ; RUN ONE SET OF TESTS
    231232  N ZTMP
    232   D ZLOAD^GPLUNIT("ZTMP","GPLCCR")
    233   D ZTEST^GPLUNIT(.ZTMP,WHICH)
     233  D ZLOAD^C0CUNIT("ZTMP","C0CCCR")
     234  D ZTEST^C0CUNIT(.ZTMP,WHICH)
    234235  Q
    235236  ;
    236237TLIST  ; LIST THE TESTS
    237238  N ZTMP
    238   D ZLOAD^GPLUNIT("ZTMP","GPLCCR")
    239   D TLIST^GPLUNIT(.ZTMP)
     239  D ZLOAD^C0CUNIT("ZTMP","C0CCCR")
     240  D TLIST^C0CUNIT(.ZTMP)
    240241  Q
    241242  ;
    242243 ;;><TEST>
    243244 ;;><PROBLEMS>
    244  ;;>>>K GPL S GPL=""
    245  ;;>>>D CCRRPC^GPLCCR(.GPL,"2","PROBLEMS","","","")
    246  ;;>>?@GPL@(@GPL@(0))["</Problems>"
     245 ;;>>>K C0C S C0C=""
     246 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","PROBLEMS","","","")
     247 ;;>>?@C0C@(@C0C@(0))["</Problems>"
    247248 ;;><VITALS>
    248  ;;>>>K GPL S GPL=""
    249  ;;>>>D CCRRPC^GPLCCR(.GPL,"2","VITALS","","","")
    250  ;;>>?@GPL@(@GPL@(0))["</VitalSigns>"
     249 ;;>>>K C0C S C0C=""
     250 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","VITALS","","","")
     251 ;;>>?@C0C@(@C0C@(0))["</VitalSigns>"
    251252 ;;><CCR>
    252  ;;>>>K GPL S GPL=""
    253  ;;>>>D CCRRPC^GPLCCR(.GPL,"2","CCR","","","")
    254  ;;>>?@GPL@(@GPL@(0))["</ContinuityOfCareRecord>"
     253 ;;>>>K C0C S C0C=""
     254 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCR","","","")
     255 ;;>>?@C0C@(@C0C@(0))["</ContinuityOfCareRecord>"
    255256 ;;><ACTLST>
    256  ;;>>>K GPL S GPL=""
    257  ;;>>>D CCRRPC^GPLCCR(.GPL,"2","CCR","","","")
    258  ;;>>>D ACTLST^GPLCCR(GPL,"ACTTEST")
     257 ;;>>>K C0C S C0C=""
     258 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCR","","","")
     259 ;;>>>D ACTLST^C0CCCR(C0C,"ACTTEST")
    259260 ;;><ACTORS>
    260  ;;>>>D ZTEST^GPLCCR("ACTLST")
    261  ;;>>>D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","G2")
    262  ;;>>>D EXTRACT^GPLACTOR("G2","ACTTEST","G3")
     261 ;;>>>D ZTEST^C0CCCR("ACTLST")
     262 ;;>>>D QUERY^C0CXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","G2")
     263 ;;>>>D EXTRACT^C0CACTOR("G2","ACTTEST","G3")
    263264 ;;>>?G3(G3(0))["</Actors>"
    264265 ;;><TRIM>
    265  ;;>>>D ZTEST^GPLCCR("CCR")
    266  ;;>>>W $$TRIM^GPLXPATH(CCDGLO)
     266 ;;>>>D ZTEST^C0CCCR("CCR")
     267 ;;>>>W $$TRIM^C0CXPATH(CCDGLO)
    267268 ;;><CCD>
    268  ;;>>>K GPL S GPL=""
    269  ;;>>>D CCRRPC^GPLCCR(.GPL,"2","CCD","","","")
    270  ;;>>?@GPL@(@GPL@(0))["</ContinuityOfCareRecord>"
     269 ;;>>>K C0C S C0C=""
     270 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCD","","","")
     271 ;;>>?@C0C@(@C0C@(0))["</ContinuityOfCareRecord>"
    271272 ;;></TEST>
Note: See TracChangeset for help on using the changeset viewer.