Mostly comment changes; minor changes here and there. Encounters now work correctly.
This commit is contained in:
parent
da8f4928af
commit
f60595f14a
12
p/C0XPT0.m
12
p/C0XPT0.m
|
@ -1,4 +1,4 @@
|
|||
C0XPT0 ; VEN/SMH - Get patient data and do something about it ;2013-05-03 6:09 PM
|
||||
C0XPT0 ; VEN/SMH - Get patient data and do something about it ;2013-05-06 9:47 AM
|
||||
;;1.1;FILEMAN TRIPLE STORE;;
|
||||
; (C) Sam Habiel 2013
|
||||
; Proprietary code. Stay out!
|
||||
|
@ -186,8 +186,9 @@ VITALS(G,DFN) ; Private EP; Process Vitals for a patient graph.
|
|||
; D EN1^GMVDCSAV(.RESULT,DATA)
|
||||
QUIT
|
||||
;
|
||||
NP() ; New Person Entry
|
||||
Q:$O(^VA(200,"B","PROVIDER,UNKNOWN SMART",0)) $O(^(0)) ; Quit if the entry exists
|
||||
NP() ; Private ; New Person Entry
|
||||
N NAME S NAME="PROVIDER,UNKNOWN SMART" ; Constant
|
||||
Q:$O(^VA(200,"B",NAME,0)) $O(^(0)) ; Quit if the entry exists with entry
|
||||
;
|
||||
N C0XFDA,C0XIEN,C0XERR,DIERR
|
||||
S C0XFDA(200,"?+1,",.01)="PROVIDER,UNKNOWN SMART" ; Name
|
||||
|
@ -201,7 +202,10 @@ NP() ; New Person Entry
|
|||
I $D(DIERR) S $EC=",U1,"
|
||||
Q C0XIEN(1) ;Provider IEN
|
||||
;
|
||||
HL() ; Hospital Location Entry
|
||||
HL() ; Private; Hospital Location Entry
|
||||
N NAME S NAME="SMART PATIENT LOCATION" ; Constant
|
||||
Q:$O(^SC("B",NAME,0)) $O(^(0)) ; Quit if the entry exists with the entry
|
||||
;
|
||||
N C0XFDA,C0XIEN,C0XERR,DIERR
|
||||
S C0XFDA(44,"?+1,",.01)="SMART PATIENT LOCATION" ; Name
|
||||
S C0XFDA(44,"?+1,",2)="C" ; Type - Clinic
|
||||
|
|
22
p/C0XPT4.m
22
p/C0XPT4.m
|
@ -1,4 +1,4 @@
|
|||
C0XPT4 ; VEN/SMH - Encounter Processing;2013-05-03 5:11 PM
|
||||
C0XPT4 ; VEN/SMH - Encounter Processing;2013-05-06 9:42 AM
|
||||
;;1.0;FILEMAN TRIPLE STORE;
|
||||
; (c) 2013 Sam Habiel
|
||||
; Currently proprietary code. Stay out!!!
|
||||
|
@ -16,7 +16,7 @@ ENC(G,DFN) ; Extract and then process encounters; PEP
|
|||
. N STARTDATE S STARTDATE=$$GSPO1^C0XGET3(G,S,"sp:startDate")
|
||||
. S STARTDATE=$$FMDATE(STARTDATE)
|
||||
. W " ",STARTDATE
|
||||
. D HISTENC(STARTDATE,DFN) ; Historical Encounter Private API
|
||||
. D ONEENC(STARTDATE,DFN) ; File One Encounter Private API
|
||||
K ^TMP($J,"ENC") ; data location
|
||||
QUIT
|
||||
;
|
||||
|
@ -34,14 +34,14 @@ FMDATE(STARTDATE) ; Internal to fix start date
|
|||
Q STARTDATE
|
||||
;
|
||||
;
|
||||
HISTENC(DATE,DFN,FTLOC,COMMENT) ; Private Proc; Historical Encounter Filing into the VISIT file
|
||||
ONEENC(DATE,DFN,FTLOC,COMMENT) ; Private Proc; One Encounter Filing into the VISIT file
|
||||
; Input:
|
||||
; - DATE: FM DATE of VISIT (Scalar) - Required
|
||||
; - DFN (Scalar) - Required
|
||||
; - FTLOC: Free Text Location - Optional. Defaults to SMART LOCATION
|
||||
; - COMMENT: Free Text Comment - Optional. Defaults to Imported from Smart
|
||||
; - FTLOC: (Scalar) Free Text Location - Optional. Defaults to SMART LOCATION
|
||||
; - COMMENT: (Scalar) Free Text Comment - Optional. Defaults to Imported from Smart
|
||||
; Output:
|
||||
; - Creates V file entries for the historical encounter
|
||||
; - Creates V file entries for encounter
|
||||
;
|
||||
; Handle required and optional variables...
|
||||
N X F X="DATE","DFN" I '$D(@X) S $EC=",U1," ; Check for the present of required input variables
|
||||
|
@ -60,25 +60,27 @@ HISTENC(DATE,DFN,FTLOC,COMMENT) ; Private Proc; Historical Encounter Filing into
|
|||
S C0XDATA("ENCOUNTER",1,"PATIENT")=DFN
|
||||
S C0XDATA("ENCOUNTER",1,"HOS LOC")=$$HL^C0XPT0()
|
||||
S C0XDATA("ENCOUNTER",1,"SERVICE CATEGORY")="A" ; Ambulatory
|
||||
S C0XDATA("ENCOUNTER",1,"OUTSIDE LOCATION")="FROM THE WIDE WORLD"
|
||||
S C0XDATA("ENCOUNTER",1,"OUTSIDE LOCATION")=FTLOC
|
||||
S C0XDATA("ENCOUNTER",1,"ENCOUNTER TYPE")="P" ; Primary
|
||||
S C0XDATA("ENCOUNTER",1,"COMMENT")=COMMENT
|
||||
S C0XDATA("PROVIDER",1,"NAME")=$$NP^C0XPT0()
|
||||
; Diangosis and procedure necessary so visit will show up in ^SDE.
|
||||
; We invent them here.
|
||||
S C0XDATA("DX/PL",1,"DIAGNOSIS")=$O(^ICD9("BA","V70.3 ",0))
|
||||
S C0XDATA("PROCEDURE",1,"PROCEDURE")=$O(^ICPT("B","99201",0))
|
||||
S C0XDATA("PROCEDURE",1,"PROCEDURE")=$O(^ICPT("B","99212",0))
|
||||
S C0XDATA("PROCEDURE",1,"QTY")=1
|
||||
;
|
||||
N C0XVISIT,C0XERR ; Visit, Error
|
||||
N XQORMUTE S XQORMUTE=1 ; Unwinder: Shut the hell up. Don't execute disabled protocols rather than whining about them.
|
||||
N OK S OK=$$DATA2PCE^PXAPI($NA(C0XDATA),PKG,SRC,.C0XVISIT,,,.C0XERR)
|
||||
I OK<1 S $EC=",U1,"
|
||||
I OK<1 S $EC=",U1," ; Invalid value is -1
|
||||
QUIT
|
||||
;
|
||||
;
|
||||
DELALL(DFN) ; Private Proc; Delete ALL ALL ALL encounter information for the patient.
|
||||
; BE VERY CAREFUL USING THIS...
|
||||
; Walk through the C X-Ref for this patient
|
||||
N I S I=9000010 ; Hit the VISIT file LAST as some xrefs in other files point to it!
|
||||
N I S I=9000010 ; Hit the VISIT file LAST as V files point to it!
|
||||
N DIK,DA
|
||||
F S I=$O(^DIC(I)) Q:I'<9000011 D ; For each V File...
|
||||
. N OR S OR=$$ROOT^DILFD(I,"",0) ; Open Root for ^DIK
|
||||
|
|
Loading…
Reference in New Issue