Changeset 1621 for fmts


Ignore:
Timestamp:
May 3, 2013, 8:52:48 PM (12 years ago)
Author:
Sam Habiel
Message:

boy oh boy now we file fully fledged ambulatory encounters that can show up on the CPRS cover sheet.

Location:
fmts/trunk/p
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fmts/trunk/p/C0XPT0.m

    r1620 r1621  
    1 C0XPT0 ; VEN/SMH - Get patient data and do something about it ;2013-05-01  9:54 AM
     1C0XPT0 ; VEN/SMH - Get patient data and do something about it ;2013-05-03  6:09 PM
    22 ;;1.1;FILEMAN TRIPLE STORE;;
    33 ; (C) Sam Habiel 2013
     
    188188 ;
    189189NP() ; New Person Entry
    190         N C0XFDA,C0XIEN,C0XERR
     190        Q:$O(^VA(200,"B","PROVIDER,UNKNOWN SMART",0)) $O(^(0)) ; Quit if the entry exists
     191        ;
     192        N C0XFDA,C0XIEN,C0XERR,DIERR
    191193        S C0XFDA(200,"?+1,",.01)="PROVIDER,UNKNOWN SMART" ; Name
    192194        S C0XFDA(200,"?+1,",1)="USP" ; Initials
    193195        S C0XFDA(200,"?+1,",28)="SMART" ; Mail Code
     196        S C0XFDA(200.05,"?+2,?+1,",.01)="`144" ; Person Class - Allopathic docs.
     197        S C0XFDA(200.05,"?+2,?+1,",2)=2700101 ; Date active
    194198        ;
    195199        N DIC S DIC(0)="" ; An XREF in File 200 requires this.
    196200        D UPDATE^DIE("E",$NA(C0XFDA),$NA(C0XIEN),$NA(C0XERR)) ; Typical UPDATE
     201        I $D(DIERR) S $EC=",U1,"
    197202        Q C0XIEN(1) ;Provider IEN
    198203        ;
     204HL() ; Hospital Location Entry
     205        N C0XFDA,C0XIEN,C0XERR,DIERR
     206        S C0XFDA(44,"?+1,",.01)="SMART PATIENT LOCATION" ; Name
     207        S C0XFDA(44,"?+1,",2)="C" ; Type - Clinic
     208        S C0XFDA(44,"?+1,",2.1)=1 ; Type Extension - Clinic
     209        S C0XFDA(44,"?+1,",3)=+$$SITE^VASITE() ; Institution - Default institution
     210        S C0XFDA(44,"?+1,",8)=295 ; STOP CODE NUMBER - Primary Care
     211        S C0XFDA(44,"?+1,",9)="M" ; SERVICE
     212        S C0XFDA(44,"?+1,",2502)="Y" ; NON-COUNT CLINIC
     213        D UPDATE^DIE("",$NA(C0XFDA),$NA(C0XIEN),$NA(C0XERR))
     214        I $D(DIERR) S $EC=",U1,"
     215        Q C0XIEN(1) ; HL IEN
  • fmts/trunk/p/C0XPT4.m

    r1620 r1621  
    1 C0XPT4 ; VEN/SMH - Encounter Processing;2013-05-01  4:09 PM
     1C0XPT4 ; VEN/SMH - Encounter Processing;2013-05-03  5:11 PM
    22 ;;1.0;FILEMAN TRIPLE STORE;
    33 ; (c) 2013 Sam Habiel
     
    1818        . W " ",STARTDATE
    1919        . D HISTENC(STARTDATE,DFN) ; Historical Encounter Private API
     20        K ^TMP($J,"ENC") ; data location
    2021        QUIT
    2122        ;
     
    5859        S C0XDATA("ENCOUNTER",1,"ENC D/T")=DATE
    5960        S C0XDATA("ENCOUNTER",1,"PATIENT")=DFN
    60         S C0XDATA("ENCOUNTER",1,"SERVICE CATEGORY")="E" ; EVENT
    61         S C0XDATA("ENCOUNTER",1,"OUTSIDE LOCATION")=FTLOC
     61        S C0XDATA("ENCOUNTER",1,"HOS LOC")=$$HL^C0XPT0()
     62        S C0XDATA("ENCOUNTER",1,"SERVICE CATEGORY")="A" ; Ambulatory
     63        S C0XDATA("ENCOUNTER",1,"OUTSIDE LOCATION")="FROM THE WIDE WORLD"
    6264        S C0XDATA("ENCOUNTER",1,"ENCOUNTER TYPE")="P" ; Primary
    63         S C0XDATA("ENCOUNTER",1,"COMMENT")=COMMENT
     65        S C0XDATA("PROVIDER",1,"NAME")=$$NP^C0XPT0()
     66        ; Diangosis and procedure necessary so visit will show up in ^SDE.
     67        S C0XDATA("DX/PL",1,"DIAGNOSIS")=$O(^ICD9("BA","V70.3 ",0))
     68        S C0XDATA("PROCEDURE",1,"PROCEDURE")=$O(^ICPT("B","99201",0))
     69        S C0XDATA("PROCEDURE",1,"QTY")=1
    6470        ;
    6571        N C0XVISIT,C0XERR ; Visit, Error
     72        N XQORMUTE S XQORMUTE=1 ; Unwinder: Shut the hell up. Don't execute disabled protocols rather than whining about them.
    6673        N OK S OK=$$DATA2PCE^PXAPI($NA(C0XDATA),PKG,SRC,.C0XVISIT,,,.C0XERR)
    67         I 'OK S $EC=",U1,"
     74        I OK<1 S $EC=",U1,"
    6875        QUIT
    6976        ;
     
    7279        ; BE VERY CAREFUL USING THIS...
    7380        ; Walk through the C X-Ref for this patient
    74         N I S I=9000009.999999999999  ; Hit the VISIT file first
     81        N I S I=9000010  ; Hit the VISIT file LAST as some xrefs in other files point to it!
    7582        N DIK,DA
    7683        F  S I=$O(^DIC(I)) Q:I'<9000011  D  ; For each V File...
     
    8390        . ; W ! ; DEBUG
    8491        ;
     92        ; Visit file
     93        N I S I=""
     94        S DIK="^AUPNVSIT("
     95        F  S I=$O(^AUPNVSIT("C",DFN,I)) Q:'I  S DA=I D ^DIK ;ditto
     96        ;
     97        ; Outpatient encounter file
    8598        N I S I=""
    8699        ; W "SCE: " ; Debug
     
    95108        N DFN S DFN=188 ; One of those Ducks
    96109        ;S LOC=$$GET^XPAR(DUZ(2)_";DIC(4,","EDPF LOCATION")
    97         S LOC=2 ; DR OFFICE
    98         N EDPKG,EDPSRC,OK
     110        N LOC S LOC=2 ; DR OFFICE
     111        N EDPKG,EDPSRC,OK,EDPDATA,EDPVISIT,ERR
    99112        S EDPKG=$O(^DIC(9.4,"B","EMERGENCY DEPARTMENT",0))
    100113        S EDPSRC="EDP TRACKING LOG"
     
    132145        S C0XDATA("ENCOUNTER",1,"COMMENT")="Testing"
    133146        ;
     147        N OK,C0XVISIT,ERR
    134148        S OK=$$DATA2PCE^PXAPI($NA(C0XDATA),PKG,SRC,.C0XVISIT,,,.ERR)
    135149        QUIT
     150TEST3 ; Test creating a real event
     151        ;
     152        N DFN S DFN=190
     153        N LOC S LOC=$$HL^C0XPT0()
     154        N PKG S PKG=$O(^DIC(9.4,"B","FILEMAN TRIPLE STORE",0))
     155        I 'PKG S $EC=",U1,"
     156        ;
     157        N SRC S SRC="FMTS TEST"
     158        ;
     159        N C0XDATA
     160        S C0XDATA("ENCOUNTER",1,"ENC D/T")=$$NOW^XLFDT
     161        S C0XDATA("ENCOUNTER",1,"PATIENT")=DFN
     162        S C0XDATA("ENCOUNTER",1,"HOS LOC")=LOC
     163        S C0XDATA("ENCOUNTER",1,"SERVICE CATEGORY")="A" ; Ambulatory
     164        S C0XDATA("ENCOUNTER",1,"OUTSIDE LOCATION")="FROM THE WIDE WORLD"
     165        S C0XDATA("ENCOUNTER",1,"ENCOUNTER TYPE")="P" ; Primary
     166        S C0XDATA("PROVIDER",1,"NAME")=$$NP^C0XPT0()
     167        S C0XDATA("DX/PL",1,"DIAGNOSIS")=$O(^ICD9("BA","V70.3 ",0))
     168        S C0XDATA("PROCEDURE",1,"PROCEDURE")=$O(^ICPT("B","99201",0))
     169        S C0XDATA("PROCEDURE",1,"QTY")=1
     170        ;
     171        N OK,C0XVISIT,ERR
     172        S OK=$$DATA2PCE^PXAPI($NA(C0XDATA),PKG,SRC,.C0XVISIT,,,.ERR)
     173        ;ZWRITE OK,C0XVISIT
     174        ;ZWRITE:$D(ERR) ERR
     175        QUIT
Note: See TracChangeset for help on using the changeset viewer.