TALONS
AHIIS Extract

Data
Sources

Business
Rules

As installed at PAH

Sources of Data

Product Data is
sourced from the AHIIS.ATT and AHIIS.REF files, while product descriptions are
sourced from the AHIIS.INTERVENTION.CODES and AHIIS.CONSUMABLE.COSTS reference
files.

Feeder System

The Feeder System
is assigned as “AHIIS”. At multicampus
sites this may be modified to reflect the Campus code as well viz  AHHVB (no Multicampus
AHIIS Sites are currently in use)

Record Selection

Records are
selected based on the date of service as recorded in attribute 1 of the
attendance record falling in the month to be processed. This is also the date
of Service.

Feeder Keys - Products

Three classes of
product are generated into Feeder Keys, The Intervention code, the Attendance
time as ATT.TIME, and the Consumables code as “CNS-ZZZZ”

Intervention
Code

This
is Multivalued (Repeating) data located in attribute
10 of the AHIIS.ATT record. The Intervention code is used raw as the product
code. The Quantity is one. (At times during development the
quantity was a scaled value of the allocated time to this intervention code
spread over the total allocated time for the whole attendance)

Attendance
time

This
is calculated from the Sum of Patient Time and Patient Attributable Time, Attributes
16 and 17 of the AHIIS.ATT record. (at
times during development the value in attribute 23 was used as the total time)

Consumable
codes

This
19 of the AHIIS.ATT record. The Consumable Costs code is used  concatenated with a modifier viz.
“CNS-zzzz”. The Quantity is one.

Other data

The  date of service is Attribute 1 of the
AHIIS.ATT record.

The
URNO is Attribute 6 of the AHIIS.REF record.

The
Department performing the service is in Attribute 8 of the AHIIS.REF record.

Business Rules

The only rules
applied are the standard Episode matching rules in order listed.

Attendances
falling within the admit date and discharge date of any inpatient episode are
linked to that episode.

Attendances
falling within the Arrival date in emergency and the two days after discharge
from emergency are linked to that Emergency attendance episode ID.

Attendances
within 30 days either way of an OP appointment (even if later cancelled) are
linked to the closest OP appointment and assigned a composite ID. (urno.clinicno.dateofappt)

Attendances
not linking are assigned an Unlinked Composite Episode ID. (urno.UL.dateofservice)

Data
definitions

010 EQU ATT$ATT.DATE
TO 1 <- Date of Service, Used for Record Selection

011 EQU ATT$PATIENT.TYPE     TO 2

012 EQU ATT$ACCOM
TO 3

013 EQU ATT$ATTEND.TYPE      TO 4

014 EQU ATT$RESEARCH2        TO 5

015 EQU ATT$RESEARCH3        TO 6

016 EQU ATT$PRIN.DIAG        TO 7

017 EQU ATT$OTHER.DIAG       TO 8

018 EQU ATT$IND.INTER        TO 9

019 EQU ATT$INT.CODE
TO 10 <- Intervention Code, Products

020 EQU ATT$INT.TIME
TO 11

021 EQU ATT$OUTCOMES
TO 12

022 EQU ATT$SERVICE
TO 13

023 EQU ATT$PAYNO
TO 14

024 EQU ATT$PAY.LEVEL        TO
15

025 EQU ATT$PAT.TIME
TO 16 }<- ATT.TIME is sum of 16 & 17

026 EQU ATT$PAT.ATT.TIME     TO 17
}

027 EQU ATT$LABOUR.COST      TO 18

028 EQU ATT$CON.CODE
TO 19 <- Consumable Codes, Used concatenated after "CNS-"

029 EQU ATT$CON.COST
TO 20

030 EQU ATT$NO.ATT
TO 21

031 EQU ATT$ADM.NO
TO 22

032 EQU ATT$TOT.INT.TIME     TO 23

033 EQU ATT$TOT.LAB.TIME     TO 24

034 EQU ATT$TOT.CON.COST     TO 25

035 EQU ATT$TOT.ATT.COST     TO 26

036 EQU ATT$PAY.RATE         TO 27

037 EQU ATT$GROUP.NO
TO 28

038 EQU ATT$PRIN.ICDID       TO 29

039 EQU ATT$OTHERDIAG.ICDID  TO 30

040 EQU ATT$IND.INT.ICDID    TO 31

008 EQUATE AR$REF.CODE
TO 1

009 EQUATE AR$TFR.DT
TO 2

010 EQUATE AR$ATTEND.TYPE
TO 3

011 EQUATE AR$REF.UNIT
TO 4

012 EQUATE AR$FIRST.TFR.DT
TO 5

013 EQUATE AR$URNO
TO 6 <- Patient URNO

014 EQUATE AR$CLINIC
TO 7

015 EQUATE AR$DEPT
TO 8 <- Dept Providing Service

016 EQUATE AR$REF.DATE
TO 9

017 EQUATE AR$RESEARCH1
TO 10

018 EQUATE AR$V1REFCODE
TO 11

Notes

At various times, the Intervention Code
product quantity has been derived from the following formula

(Intervention time for that
intervention {11,n})/(Total
of all Interventions {Summatiion of all values in
11}  * (Total time)

It is now "One"

Total time has been at times attribute
23, but is now the sum of attribute 16 and attribute 17

SUBROUTINE
EX.XVI.AHIIS(YR,MTH,FY,FP,PROGRAM,PARAMS)

*INCLUDE
TALONS.INCLUDES AHIIS.PAH.SUB.HEAD

****************************************************

* this
material is an unpublished work owned by    *

*  C.S.H.
Consultants Pty Ltd ACN 002843549        *

*all
rights are reserved, no user may view, modify *

*or copy
this or other related software without the*

* written and
express permissions of C.S.H.        *

****************************************************

*-------------------------------------------------*

*
Copyright C.S.H. Consultants
*

*
<c> 1994,1995,1996,1997
*

* James White  Copyright
*

*
<c> 1991,1995,1996,1997
*

* VERSION
T2.7.0 - OCT 97 TRANSITION TWO
*

*-------------------------------------------------*

*Program
Description EXTRACT SIXTEEN AHIISDATA - TRANSITION TWO

*Program Name  EX.XVI.AHIIS

*Version
T2.7.0

*Revision
date OCT 97

*

*

*-----------------------------------------------------------------*

PROGRAM =
"EXTRACT":"12.AHIIS"

VERSION =
"T2.7.0"

EQU AM TO CHAR(254)

CALL CSH.CURSOR(NORM,DULL,REV,UNREV,FLASH,STILL,RST)

EQU VM TO CHAR(253)

NEW = 0

SKIP = 0

RECS = 0

X = 1

VERBOSE =
PARAMS<3>

Z = ''

PROMPT ''

MTH$ =
MTH"R%2"

FIN.ID =
FY"R%2":FP"R%2"

CAL.ID =
YR"R%2":MTH"R%2"

BOM = ICONV("1 ":MTH:" ":YR,"D")

EOM = BOM
+ 35

DTE =
"1 ":OCONV(EOM,"DMA"):"
":OCONV(EOM,"DY")

EOM = ICONV(DTE,"D")

EOM = EOM
- 1

*IF BOM =
'' THEN GOTO 9999

BOM$ = OCONV(BOM,"D4-")

EOM$ = OCONV(EOM,"D4-")

BOM$ = DQUOTE(BOM$)

EOM$ = DQUOTE(EOM$)

IF VERBOSE
THEN CRT @(-1):@(0,6):BOM$,EOM$,"Allied Health
Systems Products""L#55":@(-4):

PRG.HDR =
PROGRAM:" - ":VERSION

IF VERBOSE
THEN CRT @(0,0):REV:PRG.HDR"R#79":UNREV

INCLUDE
IP.OP.INCL.OPENS.T2 FROM TALONS.INCLUDES

OPEN
'','AHIIS.ATT' TO AHIIS.ATT ELSE Z = Z:" AHIIS.ATT"

OPEN
'','AHIIS.REF' TO AHIIS.REF ELSE Z = Z:" AHIIS.REF"

OPEN
'','AHIIS.INTERVENTION.CODES' TO AHIIS.INTERVENTION.CODES ELSE Z = Z:"
AHIIS.INTERVENTION.CODES"

OPEN
'','AHIIS.CONSUMABLE.COSTS' TO AHIIS.CONSUMABLE.COSTS ELSE Z = Z:"
AHIIS.CONSUMABLE.COSTS"

OPEN
'','WARD.COSTCENTRES' TO WD.CST ELSE Z = Z:" WARD.COSTCENTRES"

OPEN
'','PRODUCT.DESC' TO PRD.DESC ELSE Z = Z:" PRODUCT.DESC"

OPEN
'','EX.XV.OP.DAT' TO EX.XV.OP.DAT    ELSE Z = Z:"
EX.XV.OP.DAT"

OPEN
"","TALONS-PARAMS" TO TALONS.PARAMS ELSE Z = Z:"
TALONS-PARAMS"

OPEN '','EX.XVI.DAT,':CAL.ID TO STATS.XVI     ELSE

READV FILESIZE FROM TALONS.PARAMS,"EX.XVI.FILESIZE",1 ELSE

ABORT "NO FILESIZE DEFINED IN TALONS-PARAMS"

END

PERFORM "CREATE-FILE
EX.XVI.DAT,":CAL.ID:" ":FILESIZE:"
(L"

OPEN '','EX.XVI.DAT,':CAL.ID TO STATS.XVI     ELSE

ABORT "CANNOT CREATE FILE"

END

END

OPEN '','EX.X.DAT,':CAL.ID TO STATS.X     ELSE

READV FILESIZE FROM TALONS.PARAMS,"EX.X.FILESIZE",1 ELSE

ABORT "NO FILESIZE DEFINED IN TALONS-PARAMS"

END

PERFORM "CREATE-FILE EX.X.DAT,":CAL.ID:"
":FILESIZE:" (L"

OPEN '','EX.X.DAT,':CAL.ID TO STATS.X     ELSE

ABORT
"CANNOT CREATE FILE"

END

END

IF Z # ''
THEN CRT Z ; STOP

FEEDER$ =
"AHIIS"

GETLIST  YR"R%2":MTH$"R%2":"AHIISS"
TO ATT.LIST SETTING LISTCOUNT THEN

LISTCOUNT = LISTCOUNT<1>"R%8"

IF PARAMS<1> = "N" THEN SKIP = 1 ;
GOTO 75

END ELSE

NULL

END

SEL =
'SELECT AHIIS.ATT USING DICT TALONS.DICTS WITH AHIIS.ATT.T1.ADATE <= ':EOM$:' AND WITH AHIIS.ATT.T1.ADATE >= ':BOM$:"
"

IF VERBOSE
THEN SEL = SEL:" (C1000"

IF VERBOSE THEN
CRT @(0,2):SEL:@(-3):@(0,10):

PERFORM
SEL RTNLIST ATT.LIST SETTING LISTCOUNT

WRITELIST
ATT.LIST ON YR"R%2":MTH$"R%2":"AHIISS"

LISTCOUNT
= LISTCOUNT<1,2>"R%8"

75    IF VERBOSE THEN CRT @(0,10):@(-3):"Re-creating the Data Files ? :"

IF SKIP =
1 AND PARAMS<2> = "N" THEN GOTO 9999

* reset
values to zeros

IF VERBOSE
THEN CRT @(0,10):"Clearing existing values to
zero please wait ..."

YRMTH =
YR"R%2":MTH$"R%2"

SEL =
'SELECT EX.XVI.DAT,':CAL.ID:'  WITH FEEDER = ':DQUOTE(FEEDER$):'  '

IF VERBOSE
THEN SEL = SEL:" (C1000"

PERFORM
SEL RTNLIST RESETS

LOOP WHILE
READNEXT ID.XVI FROM RESETS DO

DELETE STATS.XVI,ID.XVI

REPEAT

IF VERBOSE
THEN CRT @(0,10):@(-3):

IF VERBOSE
THEN CRT @(20,11):LISTCOUNT

LOOP WHILE
READNEXT ID FROM ATT.LIST DO

READ ATT.REC FROM AHIIS.ATT,ID ELSE GOTO EXRD

READ REF.REC FROM AHIIS.REF,FIELD(ID,"-",1)
ELSE GOTO EXRD

URNO = REF.REC<6>

SDATE = ATT.REC<1>

STIME = ''

*TTL.TIME = ATT.REC<23,1>

TTL.TIME = ATT.REC<16,1,1> +
ATT.REC<17,1,1>

TTL.INTVN = SUMMATION(ATT.REC<11>)

*IF TTL.TIME = 0 THEN TTL.TIME = TTL.INTVN

*IF TTL.TIME = 0 THEN
TTL.TIME = "10" ; TTL.INTV = "10"

*IF TTL.INTVN+0 = 0 THEN GOTO EXRD

IF TTL.TIME+0 = 0 THEN GOTO EXRD

RDOC = ''

IP.FLAG = 0

ADM.NO = ''

COMP = 0

N.PROCS = DCOUNT(ATT.REC<10>,VM)

DEPT = REF.REC<8,1,1>

DESC$ = ""

CLINIC = ""

UL.ID = "UL"

GOSUB 6767

P = DCOUNT(ATT.REC<10>,VM)

FOR N = 1 TO P

READV DESC$ FROM AHIIS.INTERVENTION.CODES,ATT.REC<10,N>,1
ELSE  DESC$ = ''

STAT.ID = ADM.NO:"|":YRMTH:"|":ATT.REC<10,N>:"|":FEEDER$:":":DEPT:"|":SDATE:"|":STIME:"|":RDOC

READ STAT FROM STATS.XVI,STAT.ID ELSE STAT =
NEW

READ DESC FROM PRD.DESC,FEEDER$:"|":DEPT:"|":ATT.REC<10,N>
ELSE

DESC = DESC$

WRITE DESC ON PRD.DESC,FEEDER$:"|":DEPT:"|":ATT.REC<10,N>

END

*STAT<1> = STAT<1> + (100 * (ATT.REC<11,N>/TTL.INTVN)
* TTL.TIME)

STAT<1> = STAT<1> + 100

WRITE STAT ON STATS.XVI,STAT.ID

NEXT N

STAT.ID = ADM.NO:"|":YRMTH:"|":"ATT.TIME":"|":FEEDER$:":":DEPT:"|":SDATE:"|":STIME:"|":RDOC

READ STAT FROM STATS.XVI,STAT.ID ELSE STAT =
NEW

READ DESC FROM PRD.DESC,FEEDER$:"|":DEPT:"|":"ATT.TIME"
ELSE

DESC = "Attendance time"

WRITE DESC ON PRD.DESC,FEEDER$:"|":DEPT:"|":"ATT.TIME"

END

STAT<1> = STAT<1> + 100 * TTL.TIME

WRITE STAT ON STATS.XVI,STAT.ID

IF VERBOSE
AND MOD(RECS,100) = 0 THEN CRT
@(0,11):RECS"R#6"

RECS = RECS + 1

P = DCOUNT(ATT.REC<19>,VM)

FOR N = 1 TO P

READV DESC$ FROM AHIIS.CONSUMABLE.COSTS,ATT.REC<19,N>,1
ELSE  DESC$ = ''

STAT.ID = ADM.NO:"|":YRMTH:"|":"CNS-":ATT.REC<19,N>:"|":FEEDER$:":":DEPT:"|":SDATE:"|":STIME:"|":RDOC

READ STAT FROM STATS.XVI,STAT.ID ELSE STAT =
NEW

READ DESC FROM PRD.DESC,FEEDER$:"|":DEPT:"|":"CNS-":ATT.REC<19,N>
ELSE

DESC
= DESC$

WRITE DESC ON PRD.DESC,FEEDER$:"|":DEPT:"|":"CNS-":ATT.REC<19,N>

END

STAT<1> = STAT<1> + 100

WRITE STAT ON STATS.XVI,STAT.ID

NEXT N

EXRD:
REPEAT

9999  RETURN

INCLUDE
IP.OP.INCL.T2 FROM TALONS.INCLUDES