20 lines
631 B
Mathematica
20 lines
631 B
Mathematica
SROICD ;BIR/SJA - CODE SET VERSIONING UTILITY ; [ 01/30/03 05:50 PM ]
|
|
;;3.0; Surgery ;**116,127**;24 Jun 93
|
|
;
|
|
;Reference to $$ICDDX^ICDCODE supported by DBIA #3990
|
|
;
|
|
ICDC(SRCODE) ; output principal ICD
|
|
N SRC,SRSDATE,SRDA
|
|
I $D(SRCODE),SRCODE="" Q
|
|
S SRDA=$S($G(SRTN):SRTN,$D(DA(2)):DA(2),$D(DA(1)):DA(1),$D(D0):D0,1:"")
|
|
S SRC=$$ICDDX^ICDCODE(SRCODE,$P($G(^SRF(SRDA,0)),"^",9))
|
|
Q $P(SRC,"^",2,4)
|
|
;
|
|
ACTIV(SRTN,SRCODE) ; screen for active ICD codes
|
|
K ICDVDT
|
|
N SROK,SRSDATE S SROK=1,SRSDATE=DT
|
|
I $G(SRTN) S SRSDATE=$E($P(^SRF(SRTN,0),"^",9),1,7)
|
|
S SROK=$P($$ICDDX^ICDCODE(SRCODE,SRSDATE),"^",10)
|
|
S ICDVDT=SRSDATE
|
|
Q SROK
|