Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Extra Scripts
Add the modifier "Modify Message with HL7 Script" in this window you can add Pascal Script to change your messages
Image Removed
How to use Pascal Script
Image Removed → Medical -Objects Transformation IDE →
Image Removed→ write codes(refers to the following examples) →
Image Removed →
Image Removed(open HL7 test data) → Load a HL7 test data →
Image Removed(execute script) →
Image Removed → check Input/Output Message in
Image Removed
Script Examples
Add TimeZone
No Format |
---|
program AddTimeZone;
begin
HL7Data['MSH.6.0'] := AddSpecificTimezone(HL7Data['MSH.6.0'], '+0800');
HL7Data['OBR.6.0'] := AddLocalTimezone(HL7Data['OBR.6.0']);
end. |
Replace TimeZone
No Format |
---|
program FixTimeZone;
begin
HL7Data['MSH.6.0'] := HL7TSChangeTimeZoneToLocal(HL7Data['MSH.6.0']);
HL7Data['OBR.6.0'] := HL7TSChangeTimeZone(HL7Data['OBR.6.0'], '+1200');
HL7Data['OBR.7.0'] := HL7TSChangeTimeZone(HL7Data['OBR.7.0'], '+1100');
end. |
Replace GUID
No Format |
---|
program FixGUID;
begin
if(HL7Data['MSH.3.0'] = 'Noosa Radiology') and (HL7Data['MSH.3.0.2'] = '649C452B-5EAA-4D8F-A230-F3A54F99A9D4') then
HL7Data['MSH.3.1'] := 'Practice Name^F2107173-8A7B-4C5D-A055-CB5C79C76B7E^GUID';
end. |
This program will find the specific GUID in the Sending Facility and replace it with the GUID of your choice.
Copy OBR16 to PV1-9 if PV1-9 target not set
No Format |
---|
{
This program copies the provider number from OBR-16 to PV1-9. If PV1 doesnt exist, it will insert it.
Only copy the components over if a target ID is not already set in PV1. Try to make it future proof
incase the input messages contain PV1-9 values.
}
Program AddPV19;
var
i:integer;
mshindex: integer;
pv1index:integer;
pidindex:integer;
targetid: string;
j: integer;
begin
pv1index :=-1;
while i < HL7Data.segmentcount -1 do
begin
if HL7Data.segmentname[i] = 'MSH' then
begin
mshindex := i;
pv1index :=-1;
pidindex := -1;
end
else if HL7data.segmentname[i] = 'PID' then
pidindex := i
else if HL7Data.segmentname[i] = 'PV1' then
pv1index :=i
else if ((HL7Data.segmentname[i] = 'OBR') or (HL7Data.segmentname[i] = 'ORC')) and (pv1index=-1) then
begin
HL7Data.insertsegment (PIDINDEX+1, 'PV1');
pv1index := PIDINDEX+1;
inc(i);
end;
if (HL7Data.segmentname[i] = 'OBR') and (pv1index<>-1) then
begin
if HL7Data.GetFieldvalue(pv1index, 9, 0, 0, 0)= then
begin
targetid := HL7Data.GetFieldvalue(i, 16, 0, 0, 0);
HL7Data.SetFieldvalue(targetid, pv1index, 9,0,0,0);
for j := 1 to 6 do
HL7Data.SetFieldvalue(HL7Data.GetFieldvalue(i, 16, 0, j, 0), pv1index, 9,0,j,0);
end;
end;
inc(i);
end
end. |
Available Pascal Scripts
No Format |
---|
function HL7TSChangeTimeZoneToLocal(const AHL7TS: string): string; |
No Format |
---|
function HL7TSChangeTimeZone(const AHL7TS: string; const ANewTimeZone: string): string; |
No Format |
---|
function AddSpecificTimezone(const AHL7TS, ATimeZone: String): string; |
No Format |
---|
function AddLocalTimezone(const AHL7TS: String): string; |
No Format |
---|
function StripTimezone(const AHL7TS: String): string; |
No Format |
---|
function HL7TimeZoneToBiasMinutes(const HL7TimeZone: string): Integer; |
No Format |
---|
function AgeInYears(ADateOfBirth, ADateOfAge: TDateTime): Integer; |
No Format |
---|
function AgeToDisplayString(ABirthDate, AAgeAtThisDate: TDateTime): string; |
No Format |
---|
function AutoCompleteDate(const AText: string; AddTime: Boolean = False): string; |
No Format |
---|
function DateStrToHL7DT(const AEditText: String; AAccept2DigitYears: Boolean = True; AddTimestamp:Boolean = True): string; |
No Format |
---|
procedure ScanDateStr(const ADateStr: string; out ADay, AMonth, AYear: string); |
No Format |
---|
function HL7DTDecode(const AHL7DT: string; out AYear, AMonth, ADay: Integer): Boolean; |
→ Returns -1 for parts which are not present. If not even a year is present, returns False otherwise True
No Format |
---|
function HL7DTEncode(AYear, AMonth, ADay: Integer): string; |
No Format |
---|
function HL7TMDecode(const AHL7TM: string; out AHour, AMinute, ASecond: Integer; out AFractionalSecond: Double): Boolean; |
No Format |
---|
function HL7TMEncode(AHour, AMinute: Integer; ASecond: Integer = -1; AFractionalSecond: Double = -1): string; |
No Format |
---|
function HL7TSStripTimezone(const AHL7TS: string): string; |
No Format |
---|
function HL7TMStripTimezone(const AHL7TM: string): string; |
No Format |
---|
function HL7TSToLocalTS(const AHL7TS: string; AIncludeTimeZone: Boolean = True): string; |
No Format |
---|
function HL7LocalTimeZone: string; |
No Format |
---|
function HL7TimeZoneFromTS(const AHL7TS: string): string; |
No Format |
---|
function HL7TimeZoneFromTM(const AHL7TM: string): string; |
No Format |
---|
function HL7TMGetFractionalSecond(const AHL7TM: string; out AFractionalSecond: Double): Boolean; |
No Format |
---|
function HL7TSEncode(AYear: Integer;
AMonth: Integer = -1;
ADay: Integer = -1;
AHour: Integer = -1;
AMinute: Integer = -1;
ASecond: Integer = -1;
AFractionalSecond: Double = -1.0): string; |
Objects clients contain a powerful HL7 scripting engine allowing for rapid solutions to production problems.
If you think this capability could help you, please feel free to reach out to the Medical Objects Helpdesk on (07) 5456 6000.
No Format |
---|
function HL7TSAddDay(const ADateStr: string; AIncrement: Integer = +1): string; |
→ Takes a HL7 date (or date/time) input and returns a date (or date/time)
No Format |
---|
function HL7TSAddMonth(const ADateStr: string; AIncrement: Integer = +1): string; |
No Format |
---|
function HL7TSAddYear(const ADateStr: string; AIncrement: Integer = +1): string; |
No Format |
---|
function HL7TSToTDateTime(AHL7DateTime: string): TDateTime; |
No Format |
---|
function HL7DTToTDateTime(AHL7Date: string): TDateTime; |
No Format |
---|
function HL7TMToTDateTime(AHL7Time: string): TDateTime; |
No Format |
---|
function HL7TSToSQLText(const AHL7TS: string): string; |
No Format |
---|
function HL7DTToDisplayString(const AHL7DT: string; const ADisplayFormat: string = 'd?m?yyyy'): string; |
No Format |
---|
function HL7TMToDisplayString(const AHL7TM: string; const ADisplayFormat: string = 'hh:nn'): string; |
No Format |
---|
function HL7TSToDisplayString(const AHL7TS: string; const ADisplayFormat: string = 'd.m.yyyy hh:nn'): string; |
No Format |
---|
function HL7TSToReverseGregorian(const AHL7TS: string): string; |
No Format |
---|
function HL7TSToHL7DT(const AHL7TS: string): string; |
No Format |
---|
function HL7TSToHL7TM(const AHL7TS: string): string; |
No Format |
---|
function TDateTimeToHL7DT(AInput:TDateTime): string; |
No Format |
---|
function HL7TSToDatabaseText(const AHL7TS: string): string; |
No Format |
---|
function HL7TSToTDateTimeDef(AHL7TS: String; Default:TDateTime): TDateTime; |
No Format |
---|
function MedicalDirectorDateToHL7DT(MD_Date:String): string; |
No Format |
---|
function LongMonthStringtoMonth(const AMonth:String): Word; |
No Format |
---|
function MinutesToHL7TM(const Minutes:Integer): string; |
No Format |
---|
function HL7TMtoMinutes(const HL7TM:String): Integer; |
No Format |
---|
function TDateTimeToHL7DateTimeAutoPrecision(AInput: TDateTime; AIncludeTimeZone: Boolean = False): string; |
No Format |
---|
function HL7TMtoOBXDisplayString(const AHL7TM:String): string; |
No Format |
---|
function XMLDateTimeToHL7TS(XMLDateTime: String): string; |
No Format |
---|
function DateTimeXMLToString(ADate: TDateTime): string; |
No Format |
---|
function HL7DateToXMLFormat(ADate: String): string; |
No Format |
---|
function HL7DTAddDays(const AHL7DT: string; Days :integer): String; |
No Format |
---|
function IsHL7TSValid(const HL7Date: string): Boolean; |
No Format |
---|
function ActualBiasMinutes: Integer; |
var
No Format |
---|
HL7Data: THL7Scriptable |
No Format |
---|
THL7Scriptable = class(TObject)
public
constructor Create;
destructor Destroy; override;
procedure Clear;
function ComponentCount(const SegmentIndex: Integer; const FieldNo: Integer;
const RepeatNo: Integer = 0): Integer;
function SubComponentCount(const SegmentIndex: Integer; const FieldNo: Integer;
const RepeatNo: Integer ; const ComponentNo: Integer): Integer;
procedure DeleteRepeat(const SegmentIndex: Integer; const FieldNo: Integer;
const RepeatNo: Integer );
procedure DeleteSegment(const Index: Integer);
function FieldCount(const SegmentIndex: Integer): Integer;
function GetFieldvalue(const SegmentIndex, FieldNo: Integer; const RepeatNo:
Integer = 0; const ComponentNo: Integer = 0; const SubComponentNo: Integer
= 0): string;
function IndexofSegment(const SegmentName: String): Integer;
procedure SetFieldvalue(const Value: String; const SegmentIndex, FieldNo:
Integer; const RepeatNo: Integer = 0; const ComponentNo: Integer = 0; const
SubComponentNo: Integer = 0);
procedure InsertSegment(const Index:Integer; const SegmentName: String);
procedure LoadFromFile(const AFilename: String);
procedure LoadFromStream(AStream: TStream);
function RepeatCount(const SegmentIndex: Integer; const FieldNo: Integer):
Integer;
procedure SaveToFile(const AFilename: String);
function SegmentCount: Integer;
property asString: string read GetasString write SetasString;
property Raw: Boolean read GetRaw write SetRaw;
property SegmentName[Index: Integer]: string read GetSegmentName;
property Value[Index: String]: string read GetValue write SetValue; default;
end; |
There are more functions. Contact the helpdesk for further assistance.
Table of Contents | ||||
---|---|---|---|---|
|