Changeset 78 for ccr/trunk/p


Ignore:
Timestamp:
Jul 29, 2008, 4:57:24 PM (16 years ago)
Author:
George Lilly
Message:

improved handling of missing SSN and telephone values

Location:
ccr/trunk/p
Files:
3 edited

Legend:

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

    r75 r78  
    1717 ;with this program; if not, write to the Free Software Foundation, Inc.,
    1818 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    19            ;
    20            ;  PROCESS THE ACTORS SECTION OF THE CCR
    21                    ;
    22                    ; ===Revision History===
    23                    ; 0.1 Initial Writing of Skeleton--GPL
    24                    ; 0.2 Patient Data Extraction--SMH
    25                    ; 0.3 Information System Info Extraction--SMH
    26            ;
     19    ;
     20    ;  PROCESS THE ACTORS SECTION OF THE CCR
     21    ;
     22    ; ===Revision History===
     23    ; 0.1 Initial Writing of Skeleton--GPL
     24    ; 0.2 Patient Data Extraction--SMH
     25    ; 0.3 Information System Info Extraction--SMH
     26    ;
    2727EXTRACT(IPXML,ALST,AXML) ; EXTRACT ACTOR FROM ALST INTO PROVIDED XML TEMPLATE
    28            ; IPXML is the Input Actor Template into which we are going to substitute values
    29                    ; This is straight XML. Values to be substituted are in @@VAL@@ format.
     28  ; IPXML is the Input Actor Template into which we  substitute values
     29  ; This is straight XML. Values to be substituted are in @@VAL@@ format.
     30  ; ALST is the actor list global generated by ACTLST^GPLCCR and has format:
     31  ; ^TMP(7542,1,"ACTORS",0)=Count
     32  ; ^TMP(7542,1,"ACTORS",n)="ActorID^ActorType^ActorIEN"
     33  ; ActorType is an enum containing either "PROVIDER" "PATIENT" "SYSTEM"
    3034
    31                    ; ALST is the actor list global generated by ACTLST^GPLCCR and is in the following format
    32                    ; ^TMP(7542,1,"ACTORS",0)=Count
    33                    ; ^TMP(7542,1,"ACTORS",n)="ActorID^ActorType^ActorIEN"
    34                    ; ActorType is an enum containing either "PROVIDER" "PATIENT" "SYSTEM"
    35 
    36            ; AXML is the output arrary, to contain XML.
     35  ; AXML is the output arrary, to contain XML.
    3736
    3837           N I,J,AMAP,AOID,ATYP,AIEN
     
    9089     S @AMAP@("ACTORDATEOFBIRTH")=$$DOB^CCRDPT
    9190     S @AMAP@("ACTORGENDER")=$$GENDER^CCRDPT
    92      S @AMAP@("ACTORSSN")=$$SSN^CCRDPT
    93      S @AMAP@("ACTORSSNSOURCEID")=AOID
     91     S @AMAP@("ACTORSSN")=""
     92     S @AMAP@("ACTORSSNTEXT")=""
     93     S @AMAP@("ACTORSSNSOURCEID")=""
     94     S ZX=$$SSN^CCRDPT
     95     I ZX'="" D  ; IF THERE IS A SSN IN THE RECORD
     96     . S @AMAP@("ACTORSSN")=ZX
     97     . S @AMAP@("ACTORSSNTEXT")="SSN"
     98     . S @AMAP@("ACTORSSNSOURCEID")=AOID
    9499     S @AMAP@("ACTORADDRESSTYPE")=$$ADDRTYPE^CCRDPT
    95100     S @AMAP@("ACTORADDRESSLINE1")=$$ADDR1^CCRDPT
     
    98103     S @AMAP@("ACTORADDRESSSTATE")=$$STATE^CCRDPT
    99104     S @AMAP@("ACTORADDRESSZIPCODE")=$$ZIP^CCRDPT
    100      S @AMAP@("ACTORRESTEL")=$$RESTEL^CCRDPT
    101      S @AMAP@("ACTORWORKTEL")=$$WORKTEL^CCRDPT
    102          S @AMAP@("ACTORCELLTEL")=$$CELLTEL^CCRDPT
     105     S @AMAP@("ACTORRESTEL")=""
     106     S @AMAP@("ACTORRESTELTEXT")=""
     107     S ZX=$$RESTEL^CCRDPT
     108     I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
     109     . S @AMAP@("ACTORRESTEL")=ZX
     110     . S @AMAP@("ACTORRESTELTEXT")="Residential Telephone"
     111     S @AMAP@("ACTORWORKTEL")=""
     112     S @AMAP@("ACTORWORKTELTEXT")=""
     113     S ZX=$$WORKTEL^CCRDPT
     114     I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
     115     . S @AMAP@("ACTORWORKTEL")=ZX
     116     . S @AMAP@("ACTORWORKTELTEXT")="Work Telephone"
     117     S @AMAP@("ACTORCELLTEL")=""
     118     S @AMAP@("ACTORCELLTELTEXT")=""
     119     S ZX=$$CELLTEL^CCRDPT
     120     I ZX'="" D  ; IF THERE IS A CELL PHONE IN THE RECORD
     121     . S @AMAP@("ACTORCELLTEL")=ZX
     122     . S @AMAP@("ACTORCELLTELTEXT")="Cell Phone"
    103123     S @AMAP@("ACTOREMAIL")=$$EMAIL^CCRDPT
    104124     S @AMAP@("ACTORADDRESSSOURCEID")=AOID
    105125     S @AMAP@("ACTORIEN")=AIEN
    106      S @AMAP@("ACTORSUFFIXNAME")="" ; DOES VISTA STORE THE SUFFIX?
     126     S @AMAP@("ACTORSUFFIXNAME")="" ; DOES VISTA STORE THE SUFFIX
     127     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
    107128         D DESTROY^CCRDPT
    108129     D MAP^GPLXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
     
    130151     S @AMAP@("ACTORRELATION")=""
    131152     S @AMAP@("ACTORRELATIONSOURCEID")=""
     153     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
    132154     D MAP^GPLXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
    133155     Q
     
    163185     S @AMAP@("ACTORADDRESSSTATE")=$$STATE^CCRVA200(AIEN)
    164186     S @AMAP@("ACTORPOSTALCODE")=$$POSTCODE^CCRVA200(AIEN)
    165      S @AMAP@("ACTORTELEPHONE")=$$TEL^CCRVA200(AIEN)
    166      S @AMAP@("ACTORTELEPHONETYPE")=$$TELTYPE^CCRVA200(AIEN)
     187     S @AMAP@("ACTORTELEPHONE")=""
     188     S @AMAP@("ACTORTELEPHONETYPE")=""
     189     S ZX=$$TEL^CCRVA200(AIEN)
     190     I ZX'="" D  ; THERE IS A PHONE NUMBER AVAILABLE
     191     . S @AMAP@("ACTORTELEPHONE")=ZX
     192     . S @AMAP@("ACTORTELEPHONETYPE")=$$TELTYPE^CCRVA200(AIEN)
    167193     S @AMAP@("ACTOREMAIL")=$$EMAIL^CCRVA200(AIEN)
    168194     S @AMAP@("ACTORADDRESSSOURCEID")="ACTORSYSTEM_1"
     195     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
    169196     D MAP^GPLXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
    170197     Q
  • ccr/trunk/p/GPLCCD.m

    r76 r78  
    2525       I Y<1 Q  ; EXIT
    2626       S DFN=$P(Y,U,1) ; SET THE PATIENT
    27        ; N CCRGLO
    28        D CCDRPC(.CCRGLO,DFN,"CCD","","","")
     27       ; N CCDGLO
     28       D CCDRPC(.CCDGLO,DFN,"CCD","","","")
    2929       S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCD",1))
    3030       S ONAM="PAT_"_DFN_"_CCD_V1.xml"
     
    5353    I CCRPART="CCD" S CCD=1 ; WE ARE PROCESSING A CCD
    5454    S TGLOBAL=$NA(^TMP("GPLCCR",$J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
    55     I CCD S CCRGLO=$NA(^TMP("GPLCCR",$J,DFN,"CCD")) ; GLOBAL FOR THE CCD
    56     E  S CCRGLO=$NA(^TMP("GPLCCR",$J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
     55    I CCD S CCDGLO=$NA(^TMP("GPLCCR",$J,DFN,"CCD")) ; GLOBAL FOR THE CCD
     56    E  S CCDGLO=$NA(^TMP("GPLCCR",$J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
    5757    S ACTGLO=$NA(^TMP("GPLCCR",$J,DFN,"ACTORS")) ; GLOBAL FOR ALL ACTORS
    5858    ; TO GET PART OF THE CCR RETURNED, PASS CCRPART="PROBLEMS" ETC
     
    6060    I CCD D LOAD^GPLCCD1(TGLOBAL)  ; LOAD THE CCR TEMPLATE
    6161    E  D LOAD^GPLCCR0(TGLOBAL)  ; LOAD THE CCR TEMPLATE
    62     D CP^GPLXPATH(TGLOBAL,CCRGLO) ; COPY THE TEMPLATE TO CCR GLOBAL
     62    D CP^GPLXPATH(TGLOBAL,CCDGLO) ; COPY THE TEMPLATE TO CCR GLOBAL
    6363    N CAPSAVE,CAPSAVE2 ; FOR HOLDING THE CCD ROOT LINES
    6464    S CAPSAVE=@TGLOBAL@(3) ; SAVE THE CCD ROOT
    6565    S CAPSAVE2=@TGLOBAL@(@TGLOBAL@(0)) ; SAVE LAST LINE OF CCD
    66     S @CCRGLO@(3)="<ContinuityOfCareRecord>" ; CAP WITH CCR ROOT
    67     S @TGLOBAL@(3)=@CCRGLO@(3) ; CAP THE TEMPLATE TOO
    68     S @CCRGLO@(@CCRGLO@(0))="</ContinuityOfCareRecord>" ; FINISH CAP
     66    S @CCDGLO@(3)="<ContinuityOfCareRecord>" ; CAP WITH CCR ROOT
     67    S @TGLOBAL@(3)=@CCDGLO@(3) ; CAP THE TEMPLATE TOO
     68    S @CCDGLO@(@CCDGLO@(0))="</ContinuityOfCareRecord>" ; FINISH CAP
    6969    S @TGLOBAL@(@TGLOBAL@(0))="</ContinuityOfCareRecord>" ; FINISH CAP TEMP
    7070    ;
    7171    ; DELETE THE BODY, ACTORS AND SIGNATURES SECTIONS FROM GLOBAL
    7272    ; THESE WILL BE POPULATED AFTER CALLS TO THE XPATH ROUTINES
    73     D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Body")
    74     D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Actors")
    75     I 'CCD D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Signatures")
    76     I DEBUG F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),!
    77     ;
    78     I 'CCD D HDRMAP(CCRGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
     73    D REPLACE^GPLXPATH(CCDGLO,"","//ContinuityOfCareRecord/Body")
     74    D REPLACE^GPLXPATH(CCDGLO,"","//ContinuityOfCareRecord/Actors")
     75    I 'CCD D REPLACE^GPLXPATH(CCDGLO,"","//ContinuityOfCareRecord/Signatures")
     76    I DEBUG F I=1:1:@CCDGLO@(0) W @CCDGLO@(I),!
     77    ;
     78    I 'CCD D HDRMAP(CCDGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
    7979    ; MAPPING THE PATIENT PORTION OF THE CDA HEADER
    8080    S ZX="//ContinuityOfCareRecord/recordTarget/patientRole/patient"
    81     D QUERY^GPLXPATH(CCRGLO,ZX,"ACTT1")
     81    D QUERY^GPLXPATH(CCDGLO,ZX,"ACTT1")
    8282    D PATIENT^GPLACTORS("ACTT1",DFN,"ACTORPATIENT_"_DFN,"ACTT2") ; MAP PATIENT
    8383    I DEBUG D PARY^GPLXPATH("ACTT2")
    84     D REPLACE^GPLXPATH(CCRGLO,"ACTT2",ZX)
    85     I DEBUG D PARY^GPLXPATH(CCRGLO)
     84    D REPLACE^GPLXPATH(CCDGLO,"ACTT2",ZX)
     85    I DEBUG D PARY^GPLXPATH(CCDGLO)
    8686    K ACTT1 K ACCT2
    8787    ; MAPPING THE PROVIDER ORGANIZATION,AUTHOR,INFORMANT,CUSTODIAN CDA HEADER
    8888    ; FOR NOW, THEY ARE ALL THE SAME AND RESOLVE TO ORGANIZATION
    89     D ORG^GPLACTORS(CCRGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG
    90     D CP^GPLXPATH("ACTT2",CCRGLO)
     89    D ORG^GPLACTORS(CCDGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG
     90    D CP^GPLXPATH("ACTT2",CCDGLO)
    9191    ;
    9292    K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
     
    111111    . I CCD D UNMARK^GPLXPATH(OXML) ; REMOVE THE CCR MARKUP FROM SECTION
    112112    . ; NOW INSERT THE RESULTS IN THE CCR BUFFER
    113     . D INSERT^GPLXPATH(CCRGLO,OXML,"//ContinuityOfCareRecord/Body")
     113    . D INSERT^GPLXPATH(CCDGLO,OXML,"//ContinuityOfCareRecord/Body")
    114114    . I DEBUG F GPLI=1:1:@OXML@(0) W @OXML@(GPLI),!
    115115    ; NEED TO ADD BACK IN ACTOR PROCESSING AFTER WE FIGURE OUT LINKAGE
    116     ; D ACTLST^GPLCCR(CCRGLO,ACTGLO) ; GEN THE ACTOR LIST
     116    ; D ACTLST^GPLCCR(CCDGLO,ACTGLO) ; GEN THE ACTOR LIST
    117117    ; D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT")
    118118    ; D EXTRACT^GPLACTORS("ACTT",ACTGLO,"ACTT2")
    119     ; D INSINNER^GPLXPATH(CCRGLO,"ACTT2","//ContinuityOfCareRecord/Actors")
     119    ; D INSINNER^GPLXPATH(CCDGLO,"ACTT2","//ContinuityOfCareRecord/Actors")
    120120    N I,J,DONE S DONE=0
    121121    F I=0:0 D  Q:DONE ; DELETE UNTIL ALL EMPTY ELEMENTS ARE GONE
    122     . S J=$$TRIM^GPLXPATH(CCRGLO) ; DELETE EMPTY ELEMENTS
     122    . S J=$$TRIM^GPLXPATH(CCDGLO) ; DELETE EMPTY ELEMENTS
    123123    . W "TRIMMED",J,!
    124124    . I J=0 S DONE=1 ; DONE WHEN TRIM RETURNS FALSE
    125125    I CCD D  ; TURN THE BODY INTO A CCD COMPONENT
    126126    . N I
    127     . F I=1:1:@CCRGLO@(0) D  ; SEARCH THROUGH THE ENTIRE ARRAY
    128     . . I @CCRGLO@(I)["<Body>" D  ; REPLACE BODY MARKUP
    129     . . . S @CCRGLO@(I)="<component><structuredBody>" ; WITH CCD EQ
    130     . . I @CCRGLO@(I)["</Body>" D  ; REPLACE BODY MARKUP
    131     . . . S @CCRGLO@(I)="</structuredBody></component>"
    132     S @CCRGLO@(3)=CAPSAVE ; UNCAP - TURN IT BACK INTO A CCD
    133     S @CCRGLO@(@CCRGLO@(0))=CAPSAVE2 ; UNCAP LAST LINE
     127    . F I=1:1:@CCDGLO@(0) D  ; SEARCH THROUGH THE ENTIRE ARRAY
     128    . . I @CCDGLO@(I)["<Body>" D  ; REPLACE BODY MARKUP
     129    . . . S @CCDGLO@(I)="<component><structuredBody>" ; WITH CCD EQ
     130    . . I @CCDGLO@(I)["</Body>" D  ; REPLACE BODY MARKUP
     131    . . . S @CCDGLO@(I)="</structuredBody></component>"
     132    S @CCDGLO@(3)=CAPSAVE ; UNCAP - TURN IT BACK INTO A CCD
     133    S @CCDGLO@(@CCDGLO@(0))=CAPSAVE2 ; UNCAP LAST LINE
    134134    Q
    135135    ;
     
    253253 ;;><TRIM>
    254254 ;;>>>D ZTEST^GPLCCR("CCR")
    255  ;;>>>W $$TRIM^GPLXPATH(CCRGLO)
     255 ;;>>>W $$TRIM^GPLXPATH(CCDGLO)
    256256 ;;><CCD>
    257257 ;;>>>K GPL S GPL=""
  • ccr/trunk/p/GPLCCR0.m

    r77 r78  
    552552 ;;<IDs>
    553553 ;;<Type>
    554  ;;<Text>SSN</Text>
     554 ;;<Text>@@ACTORSSNTEXT@@</Text>
    555555 ;;</Type>
    556556 ;;<ID>@@ACTORSSN@@</ID>
     
    574574 ;;<Value>@@ACTORRESTEL@@</Value>
    575575 ;;<Type>
    576  ;;<Text>Residential Telephone</Text>
     576 ;;<Text>@@ACTORRESTELTEXT@@</Text>
    577577 ;;</Type>
    578578 ;;</Telephone>
     
    580580 ;;<Value>@@ACTORWORKTEL@@</Value>
    581581 ;;<Type>
    582  ;;<Text>Work Telephone</Text>
     582 ;;<Text>@@ACTORWORKTELTEXT@@</Text>
    583583 ;;</Type>
    584584 ;;</Telephone>
     
    586586 ;;<Value>@@ACTORCELLTEL@@</Value>
    587587 ;;<Type>
    588  ;;<Text>Cell phone</Text>
     588 ;;<Text>@@ACTORCELLTELTEXT@@</Text>
    589589 ;;</Type>
    590590 ;;</Telephone>
     
    691691 ;;<Source>
    692692 ;;<Actor>
    693  ;;<ActorID>@@ACTORSOURCEID</ActorID>
     693 ;;<ActorID>@@ACTORSOURCEID@@</ActorID>
    694694 ;;</Actor>
    695695 ;;</Source>
Note: See TracChangeset for help on using the changeset viewer.