Meditech NPR Reports / NPR Report Writing / NPR Report Writer / Meditech NPR / Non-Procedural Report / Meditech Consulting / Meditech Reports MediTech HL7 Interfaces

Wednesday, May 30, 2007

HealthCare IT Data Management

http://www.healthdatamanagement.com

Monday, May 28, 2007

HL7 V2 over XML

Barry Smith @ http://hl7-watch.blogspot.com recommends avoiding HL7 V3 and instead communicating via HL7 V2.X over XML.

HL7 Watch

http://hl7-watch.blogspot.com/

Monday, May 21, 2007

Start Background Job - Dollar T ($T)

J(%["DOLLAR.T.PROGRAM.NAME"],%Z.fpn(^%),%Z.fpn(^$),"","MIS.NAME","DB.NAME")

Monday, May 14, 2007

MUSE Commercial Members List

http://www.museweb.org/commercial/index.htm

Thursday, May 03, 2007

HL7 Interfaces - Assigning Ports, Avoiding Conflict

Reference: http://www.iana.org/assignments/port-numbers
- Well known ports range from 0 to 1023.
- Registered ports range from 1024 to 49151.
- Private or dynamic ports range from 49152 to 65535.

Thursday, April 26, 2007

NMI Interface Messages

DPM: NMI.OVQ
STRUCT: &NMXQ[connection,message]

Friday, April 20, 2007

HL7 Patient Type: IN

When PV1.18 has a value of IN then you know the patient is scheduled for a bed to spend the night.

Thursday, April 19, 2007

HL7 Event Types

A01 ADT/ACK - Admit/visit notification
A02 ADT/ACK - Transfer a patient
A03 ADT/ACK - Discharge/end visit
A04 ADT/ACK - Register a patient
A05 ADT/ACK - Pre-admit a patient
A06 ADT/ACK - Change an outpatient to an inpatient
A07 ADT/ACK - Change an inpatient to an outpatient
A08 ADT/ACK - Update patient information
A09 ADT/ACK - Patient departing - tracking
A10 ADT/ACK - Patient arriving - tracking
A11 ADT/ACK - Cancel admit/visit notification
A12 ADT/ACK - Cancel transfer
A13 ADT/ACK - Cancel discharge/end visit
A14 ADT/ACK - Pending admit
A15 ADT/ACK - Pending transfer
A16 ADT/ACK - Pending discharge
A17 ADT/ACK - Swap patients
A18 ADT/ACK - Merge patient information
A19 QRY/ADR - Patient query
A20 ADT/ACK - Bed status update
A21 ADT/ACK - Patient goes on a leave of absence
A22 ADT/ACK - Patient returns from a leave of absence
A23 ADT/ACK - Delete a patient record
A24 ADT/ACK - Link patient information
A25 ADT/ACK - Cancel pending discharge
A26 ADT/ACK - Cancel pending transfer
A27 ADT/ACK - Cancel pending admit
A28 ADT/ACK - Add person information
A29 ADT/ACK - Delete person information
A30 ADT/ACK - Merge person information
A31 ADT/ACK - Update person information
A32 ADT/ACK - Cancel patient arriving - tracking
A33 ADT/ACK - Cancel patient departing - tracking
A34 ADT/ACK - Merge patient information - patient ID only
A35 ADT/ACK - Merge patient information - account number only
A36 ADT/ACK - Merge patient information - patient ID and account number
A37 ADT/ACK - Unlink patient information
A38 ADT/ACK - Cancel pre-admit
A39 ADT/ACK - Merge person patient ID
A40 ADT/ACK - Merge patient patient identifier list
A41 ADT/ACK - Merge account - patient account number
A42 ADT/ACK - Merge visit - visit number
A43 ADT/ACK - Move patient information patient identifier list
A44 ADT/ACK - Move account information - patient account number
A45 ADT/ACK - Move visit information - visit number
A46 ADT/ACK - Change patient ID
A47 ADT/ACK - Change patient identifier list
A48 ADT/ACK - Change alternate patient ID
A49 ADT/ACK - Change patient account number
A50 ADT/ACK - Change visit number
A51 ADT/ACK - Change alternate visit ID
C01 CRM - Register a patient on a clinical trial
C02 CRM - Cancel a patient registration on clinical trial
C03 CRM - Correct/update registration information
C04 CRM - Patient has gone off a clinical trial
C05 CRM - Patient enters phase of clinical trial
C06 CRM - Cancel patient entering a phase (clerical mistake)
C07 CRM - Correct/update phase information
C08 CRM - Patient has gone off phase of clinical trial
C09 CSU - Automated time intervals for reporting, like monthly
C10 CSU - Patient completes the clinical trial
C11 CSU - Patient completes a phase of the clinical trial
C12 CSU - Update/correction of patient order/result information
CNQ QRY/EQQ/SPQ/VQQ/RQQ - Cancel query
I01 RQI/RPI - Request for insurance information
I02 RQI/RPL - Request/receipt of patient selection display list
I03 RQI/RPR - Request/receipt of patient selection list
I04 RQD/RPI - Request for patient demographic data
I05 RQC/RCI - Request for patient clinical information
I06 RQC/RCL - Request/receipt of clinical data listing
I07 PIN/ACK - Unsolicited insurance information
I08 RQA/RPA - Request for treatment authorization information
I09 RQA/RPA - Request for modification to an authorization
I10 RQA/RPA - Request for resubmission of an authorization
I11 RQA/RPA - Request for cancellation of an authorization
I12 REF/RRI - Patient referral
I13 REF/RRI - Modify patient referral
I14 REF/RRI - Cancel patient referral
I15 REF/RRI - Request patient referral status
M01 MFN/MFK - Master file not otherwise specified (forbackward compatibility only)
M02 MFN/MFK - Master file staff practitioner
M03 MFN/MFK - Master file - test/observation (for backwardcompatibility only)
M04 MFN/MFK - Master files charge description
M05 MFN/MFK - Patient location master file
M06 MFN/MFK - Clinical study with phases and schedules master file
M07 MFN/MFK - Clinical study without phases but with schedules master file
M08 MFN/MFK - Test/observation (numeric) master file
M09 MFN/MFK - Test/observation (categorical) master file
M10 MFN/MFK - Test /observation batteries master file
M11 MFN/MFK - Test/calculated observations master file
O01 ORM - Order message (also RDE, RDS, RGV, RAS)
O02 ORR - Order response (also RRE, RRD, RRG, RRA)
P01 BAR/ACK - Add patient accounts
P02 BAR/ACK - Purge patient accounts
P03 DFT/ACK - Post detail financial transaction
P04 QRY/DSP Generate bill and A/R statements
P05 BAR/ACK Update account
P06 BAR/ACK - End account
P07 PEX - Unsolicited initial individual product experience report
P08 PEX - Unsolicited update individual product experience report
P09 SUR - Summary product experience report
PC1 PPR - PC/ Problem Add
PC2 PPR - PC/ Problem Update
PC3 PPR - PC/ Problem Delete
PC4 QRY - PC/ Problem Query
PC5 PRR - PC/ Problem Response
PC6 PGL - PC/ Goal Add
PC7 PGL - PC/ Goal Update
PC8 PGL - PC/ Goal Delete
PC9 QRY - PC/ Goal Query
PCA PPV - PC/ Goal Response
PCB PPP - PC/ Pathway (Problem-Oriented) Add
PCC PPP - PC/ Pathway (Problem-Oriented) Update
PCD PPP - PC/ Pathway (Problem-Oriented) Delete
PCE QRY - PC/ Pathway (Problem-Oriented) Query
PCF PTR - PC/ Pathway (Problem-Oriented) Query Response
PCG PPG - PC/ Pathway (Goal-Oriented) Add
PCH PPG - PC/ Pathway (Goal-Oriented) Update
PCJ PPG - PC/ Pathway (Goal-Oriented) Delete
PCK QRY - PC/ Pathway (Goal-Oriented) Query
PCL PPT - PC/ Pathway (Goal-Oriented) Query Response
Q01 QRY/DSR - Query sent for immediate response
Q02 QRY/QCK - Query sent for deferred response
Q03 DSR/ACK - Deferred response to a query
Q04 EQQ Embedded query language query
Q05 UDM/ACK - Unsolicited display update message
Q06 OSQ/OSR - Query for order status
Q07 VQQ Virtual table query
Q08 SPQ Stored procedure request
Q09 RQQ event replay query
R01 ORU/ACK - Unsolicited transmission of an observation message
R02 QRY - Query for results of observation
R03 QRY/DSR Display-oriented results, query/unsol. update
R04 ORF - Response to query; transmission of requested observation
R05 QRY/DSR - query for display results
R06 UDM - unsolicited update/display results
R07 EDR enhanced display response
R08 TBR tabular data response
R09 ERP event replay response
RAR RAR - Pharmacy administration information query response
RDR RDR - Pharmacy dispense information query response
RER RER - Pharmacy encoded order information query response
RGR RGR - Pharmacy dose information query response
R0R R0R - Pharmacy prescription order query response
S01 SRM/SRR - Request new appointment booking
S02 SRM/SRR - Request appointment rescheduling
S03 SRM/SRR - Request appointment modification
S04 SRM/SRR - Request appointment cancellation
S05 SRM/SRR - Request appointment discontinuation
S06 SRM/SRR - Request appointment deletion
S07 SRM/SRR - Request addition of service/resource on appointment
S08 SRM/SRR - Request modification of service/resource on appointment
S09 SRM/SRR - Request cancellation of service/resource on appointment
S10 SRM/SRR - Request discontinuation of service/resource on appointment
S11 SRM/SRR - Request deletion of service/resource on appointment
S12 SIU/ACK - Notification of new appointment booking
S13 SIU/ACK - Notification of appointment rescheduling
S14 SIU/ACK - Notification of appointment modification
S15 SIU/ACK - Notification of appointment cancellation
S16 SIU/ACK - Notification of appointment discontinuation
S17 SIU/ACK - Notification of appointment deletion
S18 SIU/ACK - Notification of addition of service/resource on appointment
S19 SIU/ACK - Notification of modification of service/resource on appointment
S20 SIU/ACK - Notification of cancellation of service/resource on appointment
S21 SIU/ACK - Notification of discontinuation of service/resource on appointment
S22 SIU/ACK - Notification of deletion of service/resource on appointment
S23 SIU/ACK - Notification of blocked schedule time slot(s)
S24 SIU/ACK - Notification of opened (unblocked) schedule time slot(s)
S25 SQM/SQR - Schedule query message and response
S26 SIU/ACK Notification that patient did not show up for schedule appointment
T01 MDM/ACK - Original document notification
T02 MDM/ACK - Original document notification and content
T03 MDM/ACK - Document status change notification
T04 MDM/ACK - Document status change notification and content
T05 MDM/ACK - Document addendum notification
T06 MDM/ACK - Document addendum notification and content
T07 MDM/ACK - Document edit notification
T08 MDM/ACK - Document edit notification and content
T09 MDM/ACK - Document replacement notification
T10 MDM/ACK - Document replacement notification and content
T11 MDM/ACK - Document cancel notification
T12 QRY/DOC - Document query
V01 VXQ - Query for vaccination record
V02 VXX - Response to vaccination query returning multiple PID matches
V03 VXR - Vaccination record response
V04 VXU - Unsolicited vaccination record update
W01 ORU - Waveform result, unsolicited transmission of requested information
W02 QRF - Waveform result, response to query

Monday, April 16, 2007

HL7 Acknowledgement Codes (MSA.1)

AA - Application Accept
AE - Application Error
AR - Application Reject
CA - Commit Accept
CE - Commit Error
CR - Commit Reject

Friday, March 23, 2007

Entering ASCII Codes in Windows

To enter an ASCII code for a control character into a Text Editor; you can't type in an ASCII code for a Line Feed with is ASCII OCT 012. To enter this in the text editor, you enter: ALT+012. Or you could describe that action as holding down the ALT key while typing 012.

In TextPad, the regular expression for 012 the LineFeed is <\f>.

Thursday, March 22, 2007

Compendium

compendium: a full list or inventory

Wednesday, March 21, 2007

Magic Free Space

The $FC(0) utility allows you to enter a machine name and see what's free, used and totaled by blocks.

You can use the Operator Menu (OPS) #3, #14 to magnify machine / directory / and prefix destinations.

You can also open a database and loop on the open data prefix : or dictionary prefix & to see what's used in bytes for each prefix. ""^Q^T,DO{>(:[Q],X)^Q (L(Q)+L(X)+TOT)^TOT},N("TotalBytesUsed: "_TOT)^#

Friday, March 02, 2007

HL7 Acknowledgements, Necessary to Archive?

In HL7 transactions, I understand it to be common practice for the sending party to be able to provide the control id from the HL7 Acknowledgement if a message is missed. Having the sending party produce control ids for sent messages proves successful HL7 acknowledgement from the receiving party, showing that the problem is on the receiving side.

This situation reminds me of examples from everyday life experiences .

Example One: Person comes in wanting cash refund for merchandise. Employee says, "Do you have your receipt?". A receipt would be 'proof of purchase'. If the person desiring a refund cannot provide 'proof of purchase'; then standard procedure is to cut your losses and issue a gift card.

Example Two: Renter at the apartment complex doesn't pay rent. Manager sends notice to renter to pay rent or move out. Manager takes renter to court seeking eviction. The judge asks whether the renter was given proper notice, that if they did not pay rent they would be forced to move out. The manager can't say I told the renter pay rent, they have to provide commonly accepted 'proof of notice'. The Manager presents a certified letter receipt to the judge as 'proof of notice'.

Just having the sending party 'resend messages' seems a lot like giving a gift card to the person without 'proof of purchase'; you cut your losses and move on without knowing what actually happened.

It is absolutely necessary to have the sending party produce control ids for sent messages to be sure the problem with missing messages is on the receiving side.

Thursday, February 01, 2007

RO1 HL7 Event

An RO1 is an "Unsolicited transmission of an observation message".

Web Reference: http://www.hl7.org.za/patient/ch700007.htm

Monday, January 22, 2007

HL7 (MLLP) Message Wrappers

HL7 (MLLP) Minimal Lower Layer Protocol:

Start Block <SB> is a VT (vertical tab) as ASCII 11.
End Block <EB> is a FS (file separator) as ASCII 28.
Segment Separator <CR> is a CR (carriage return) as ASCII 13.

Messages are prefixed with a <SB> character. Segments are terminated with a <CR>. Messages are terminated with two characters: <EB><CR>.

Here is an example:

<SB>MSH^~\&199809091533ORU^R01856369D2.2<CR>
PID139385000343456<CR>
ORC123112312RAD19980909-0005<CR><EB><CR>

Thursday, November 30, 2006

MRI Module

MRI: Medical Record Indexing Application

Monday, November 27, 2006

Magic Machine and Directory

Machine: $MAC
Directory: /.DIR

Sunday, November 26, 2006

List Structures for a Prefix

; List Structures for a Prefix
""^Q,DO{+:[Q]^Q N(Q)^#}

Tuesday, November 14, 2006

Magic Next or Prev Get

For the following: X has your data; Q is your subscript for the structure.

Next Get: >(:OTDPTEGT[Q],X)^Q,X
Prev Get: <(:OTDPTEGT[Q],X)^Q,X

Monday, October 30, 2006

Pharmacy Orders

RDE: an RDE message is an encoded order messsage.
ORC 7: Quantity Timing
ORC 7-2:Interval
RDE precedes an RGV (order precedes the give message)

Friday, October 27, 2006

Data By Delimiter

"MSH|1|DATA|HOSP.CODE"^MSG,
3^CMP.NPR,
"|"^DELIM,
MSG(CMP.NBR_DELIM) returns "HOSP.CODE"

Sunday, October 15, 2006

Magic Background Translate Monitoring

Background Translation Status:
&[BKTRANS,DATE,"machine","workstation"] = 20061015
&[BKTRANS,STATUS,"machine","workstation"] = MIS.DC.count.dict.entries.is

Friday, October 13, 2006

Open Client and Server Ports

Open to a listening port:
"10.0.0.1"^IP,"23"^PORT,O(!,"i"_IP_"p"_PORT_"l"_0_"e"_255.255.255.255.255.255_"I8")

Open a listening port:
O(!,"i0.0.0.0p0l"_"23"_"e0.0.0.0.0.0I8")

Wednesday, September 27, 2006

Upload $T Program

UPLOADING A $T PROGRAM:
1) Create the program in TR and save.
2) "C:\DOWNLOADS\FILE.TXT"^FILE,"FILE"^PROGRAM,O(%,%.MACRO),$COPY2MAGIC.TEXT(FILE,%S[PROGRAM],254)
3) Immediately Seg Back to your starting directory.
4) Use TR to translate the code.

Monday, August 28, 2006

Killing Structures with NIL as first subscript.

If you have a magic structure with a primary subscript of nil; you do not want to perform a kill like this: K(:[""]) . Kill of nil will kill all data under the : prefix. Even tho your structure has a value at :["",123], you cannot kill on nil as that kills the entire structure. Performing a physical next on the structure would get it done: ""^Q,""^QQ,DO{>:[Q,QQ]^QQ ""^:[Q,QQ]}.

Friday, August 04, 2006

Find Replace MT String

"U"^C,DO{X#(L(X,C)^P) (X$P)_(X%P)^X}

Monday, July 31, 2006

Generic Meditech Node Count

"ADM.PAT"^FILE,0^CTR,""^Q,DO{>:[FILE,Q]^Q CTR+1^CTR},CTR

Tuesday, July 25, 2006

Upload / Download Files MT

$COPY2MAGIC.TEXT("C:\FILE",%FILE,200)
$COPY2DOS("C:\FILE",%FILE)

Thursday, July 20, 2006

Restore MT Prefix for a Structure

This would be handy if you'd changed prefix for the structure like: @Chg.prefix(ADM.PAT,:,!)
Restore Prefix: @Res.prefix(ADM.PAT,:)

Change Prefix For Structure

To change a prefix for a structure and not the whole prefix.
@Chg.prefix(ADM.BILL,:,!)
@Chg.prefix(ADM.PAT,:,!)

Friday, July 14, 2006

ZS Function (Meditech Magic)

ZS(STRING) returns the ASCII total for all bytes in the variable STRING.

If STRING = "ABC" the returned value will be 198

Monday, July 10, 2006

Front End Help

R Recalls last line of code RR Recalls last command
S Calls $SEG D Calls $DIR
CL Closes open prefixes TR Calls $T(1)
TM Calls $T(2) TU Calls $T(0)
WHO Calls $WHO ' Executes T("")
OA Calls Office Automation TIM Calls $TIME
AMS Calls Acct Mngmnt System DESK Calls DESKTOP system
HALT Calls $HALT P Calls $PPP
E Calls $EP ET Calls $ET
ALL Sign-on to any NPR appl. WHERE Current directory
OPS Calls the operators menu EO ESS open
CH Changes Workstation header text
OPEN Argument optional. If %.OPEN exists, calls it. If not, the
application and application DB are prompted for. Application
dictionary, FIS dictionary and data files are opened
OP Displays open prefixes
G <^node> Calls $G, which prompts for a node unless
passed in as an argument
GP Calls $G in PTR format for pointers
GB Calls $GB, list globals backwards
SPY Calls $INFO
L Calls $P, last two arguments are optional

A history of the last 50 user inputs is kept in a command buffer. The following
commands can be used to access the buffer:

HIST Displays the command buffer
HIST K Kills the command buffer
HIST Retrieves a specific command

The up and down arrows can be used to scroll through the buffer and retrieve
the user inputs that way.

User inputs can also be assigned to function keys. Typing a string and hitting
a function key will 'store' that string in that function key. The following
commands can be used to access the function key definitions:

HISTF Displays the function key definitions
HISTF K Kills the function key definitions
-F<1-20> Retrieves a specific function key definition

Lookups have been added to the E, ET and P commands. Typing:



will display a lookup of files. Omitting the prefix will mean a default of %

Wednesday, June 14, 2006

Print SAF to Screen

; Dump data out of a SAF to screen.
DO{>% N(%:0X)^#}

Monitor CPU in OPS - MAGIC

1) Identify CPU consumers: OPS Option 4 / Option 3 / Magnify Queues (F12)

2) Identify CPU %: OPS Option 4 / Option 7 / Magnify Machine in Question (from step 1)

Tuesday, May 30, 2006

Saving Meditech Prefix Pointer

Sometimes you'll need to seg to a segment and directory; open a prefix to a Meditech data structure. Then your main program runs on another segment and directory. To save off the pointer, seg to the segment and directory; open a prefix to a structure. O(!,%.ADM.data[A,B]) Close the prefix and assign to a variable. C(!)^/...ADM.DATA To open and reference the structure later, open a prefix to the /...ADM.DATA variable. O(!,/...ADM.DATA).

Magic Find Replace for Meditech

DO{L(/ASTMP,"*")^POS < L(/ASTMP) /ASTMP$POS_(/ASTMP%POS)^/ASTMP}

Wednesday, May 24, 2006

Return Program's Job Number

S("J")

Friday, May 12, 2006

Buffer Characters

*[n] n characters are read from the buffer. If n is greater than the number of characters in the buffer, the device hangs.

>* or +* returns the number of characters in the buffer. Nil is returned instead of 0 if no characters in the buffer.

*[>*!0] all characters in the buffer are read.

Print SAS To Screen

O(/,%SAS),DO{+/ N(/)^#}

Strip Punctuation By Atom

STRIP.PUNCTUATION
0^i,
DO{@1#(i_"A")^j?1p @1'#(i_"A")^@1;j i+1^1}

Strip Punctuation String

STRIP.PUNCTUATION
L(@1)^c,DO{c-1^c'<0 IF{@1#C?1A;21"#C^@1}}

Determine Whether Prefix Is Open

To determine whether a prefix is open use the Magic Open Command O($) "$" being the prefix you want to check. If O($) returns nil, the prefix isn't open. If O($) returns a value, the prefix is open.

Tuesday, May 09, 2006

Viewing Base Nodes Wildcard

If you have a structure:
/ERR[111] = some information
/ERR[111,A] = different information
/ERR[111],B,1] = more information
/ERR[112] = some information
/ERR[112,A] = different information
/ERR[112],B,1] = more information

You may want to see the base nodes from a certain point forward.

/ERR[100:] will return this:

/ERR[111] = some information
/ERR[112] = some information

Friday, May 05, 2006

Seg to Machine & Directory

$SEGS(MACHINE,DIRECTORY)

Monday, April 17, 2006

List Structures in a Prefix (&)

O(\,"P"),""^SUB,DO{+&[SUB]^SUB SUB^/SLASH[SUB]}

/[SLASH,.ERR] = .ERR
/[SLASH,PM] = PM
/[SLASH,TF] = TF
/[SLASH,ZADT] = ZADT

Or just type: L / if slash is your prefix at the front end.

Thursday, April 06, 2006

RAD Interfaces Acronyms

PACS: Picture Archiving and Communication System
RIS: Radiology Information System


MSH: Message Header
PID: Patient Identifier
PV1: Patient Visit
OBR: Observation Request
OBX: Observation Result
NTE: Notes & Comments

Tuesday, March 14, 2006

Interface Test List

- delivery of data (does the destination repository receive and update all transmitted messages?)
- delivery of acknowledgement (does the interface engine receive the expected acknowledgement from the destination repository?)
- data quality (report on data elements in repository and compare to source data, generate statistics)

Interface Standardization

Benefits of interface standardization via templates:
- standard naming convention
- standardized segment structure
- standardized user-exits

Introduction

When there is something to post, something will be posted.