Changeset 1621 for fmts/trunk/p/C0XPT4.m
- Timestamp:
- May 3, 2013, 8:52:48 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmts/trunk/p/C0XPT4.m
r1620 r1621 1 C0XPT4 ; VEN/SMH - Encounter Processing;2013-05-0 1 4:09PM1 C0XPT4 ; VEN/SMH - Encounter Processing;2013-05-03 5:11 PM 2 2 ;;1.0;FILEMAN TRIPLE STORE; 3 3 ; (c) 2013 Sam Habiel … … 18 18 . W " ",STARTDATE 19 19 . D HISTENC(STARTDATE,DFN) ; Historical Encounter Private API 20 K ^TMP($J,"ENC") ; data location 20 21 QUIT 21 22 ; … … 58 59 S C0XDATA("ENCOUNTER",1,"ENC D/T")=DATE 59 60 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" 62 64 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 64 70 ; 65 71 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. 66 73 N OK S OK=$$DATA2PCE^PXAPI($NA(C0XDATA),PKG,SRC,.C0XVISIT,,,.C0XERR) 67 I 'OKS $EC=",U1,"74 I OK<1 S $EC=",U1," 68 75 QUIT 69 76 ; … … 72 79 ; BE VERY CAREFUL USING THIS... 73 80 ; Walk through the C X-Ref for this patient 74 N I S I=90000 09.999999999999 ; Hit the VISIT file first81 N I S I=9000010 ; Hit the VISIT file LAST as some xrefs in other files point to it! 75 82 N DIK,DA 76 83 F S I=$O(^DIC(I)) Q:I'<9000011 D ; For each V File... … … 83 90 . ; W ! ; DEBUG 84 91 ; 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 85 98 N I S I="" 86 99 ; W "SCE: " ; Debug … … 95 108 N DFN S DFN=188 ; One of those Ducks 96 109 ;S LOC=$$GET^XPAR(DUZ(2)_";DIC(4,","EDPF LOCATION") 97 S LOC=2 ; DR OFFICE98 N EDPKG,EDPSRC,OK 110 N LOC S LOC=2 ; DR OFFICE 111 N EDPKG,EDPSRC,OK,EDPDATA,EDPVISIT,ERR 99 112 S EDPKG=$O(^DIC(9.4,"B","EMERGENCY DEPARTMENT",0)) 100 113 S EDPSRC="EDP TRACKING LOG" … … 132 145 S C0XDATA("ENCOUNTER",1,"COMMENT")="Testing" 133 146 ; 147 N OK,C0XVISIT,ERR 134 148 S OK=$$DATA2PCE^PXAPI($NA(C0XDATA),PKG,SRC,.C0XVISIT,,,.ERR) 135 149 QUIT 150 TEST3 ; 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.