Changeset 1621
- Timestamp:
- May 3, 2013, 8:52:48 PM (12 years ago)
- 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-0 1 9:54 AM1 C0XPT0 ; VEN/SMH - Get patient data and do something about it ;2013-05-03 6:09 PM 2 2 ;;1.1;FILEMAN TRIPLE STORE;; 3 3 ; (C) Sam Habiel 2013 … … 188 188 ; 189 189 NP() ; 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 191 193 S C0XFDA(200,"?+1,",.01)="PROVIDER,UNKNOWN SMART" ; Name 192 194 S C0XFDA(200,"?+1,",1)="USP" ; Initials 193 195 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 194 198 ; 195 199 N DIC S DIC(0)="" ; An XREF in File 200 requires this. 196 200 D UPDATE^DIE("E",$NA(C0XFDA),$NA(C0XIEN),$NA(C0XERR)) ; Typical UPDATE 201 I $D(DIERR) S $EC=",U1," 197 202 Q C0XIEN(1) ;Provider IEN 198 203 ; 204 HL() ; 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-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.