puma-repository-applications Mailing List for PUMA Repository
Pascal Units for Medical Applications
Brought to you by:
jwdietrich
You can subscribe to this list here.
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2015 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Johannes W. D. <joh...@ru...> - 2015-02-19 21:23:35
|
HL7 defines a plethora of segments. The PUMA HL7 engine implements only the most common segment types. It is easy, however, to write your own code for custom segments. There are several ways to achieve this. In theory there are five options, but I recommend that you follow the example of the PV1 segment (see below): Option 1: Define the whole message as text string and create a THL7Message object from this string: const EXAMPLE_SEGMENT1 = 'MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04| 1817457|D|2.5|'; EXAMPLE_SEGMENT2 = 'PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203| M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON| 400003403~1129086|'; EXAMPLE_SEGMENT3 = 'NK1||ROE^MARIE^^^^|SPO||(216)123-4567|| EC|||||||||||||||||||||||||||'; EXAMPLE_SEGMENT4 = 'PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684||||||||||||||||||||||||| 199912271408||||||002376853'; EXAMPLE_MESSAGE1 = EXAMPLE_SEGMENT1 + SEGMENT_DELIMITER + EXAMPLE_SEGMENT2 + SEGMENT_DELIMITER + EXAMPLE_SEGMENT3 + SEGMENT_DELIMITER + EXAMPLE_SEGMENT4; var TestHL7Message: THL7Message; TestHL7Message := THL7Message.Create('2.5'); TestHL7Message.contentString := EXAMPLE_MESSAGE1; This is a possible but quite inflexible way that may be not very suitable for most real-world applications. Of course, however, you can replace the constants by variables that result from string operations, which will make this code more flexible. Option 2: Define every segment as string and compose your message from single segments: const EXAMPLE_SEGMENT2 = 'PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203| M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON| 400003403~1129086|'; var TestHL7Message: THL7Message; TestHL7Message := THL7Message.Create('2.5'); TestHL7Message.AllocSegments(EXAMPLE_SEGMENT2); This approach is somewhat more flexible. Option 3: Construct the segment from single fields and your message from segments as required: const EXAMPLE_FIELD1 = '0493575^^^2^ID 1'; EXAMPLE_FIELD2 = '168 ~219~C~PMA^^^^^^^^^'; EXAMPLE_FIELD3 = 'DOE^JOHN^^^^'; EXAMPLE_FIELD4 = '254 MYSTREET AVE^^MYTOWN^OH^44123^USA'; EXAMPLE_FIELD5 = 'BID&Twice a day at institution specified times&HL7xxx^^^^12^h^Y|'; EXAMOLE_FIELD6 = '13.5&18^M~12.0 & 16^F'; var TestHL7Message: THL7Message; TestHL7Message := THL7Message.Create('2.5'); if TestHL7Message.NewSegment = nil then fail('Segment could not be created.') else begin TestHL7Message.FirstSegment.NewOccurrence(''); if TestHL7Message.FirstSegment.FirstOccurrence = nil then fail('Occurrence could not be created.') else begin TestHL7Message.FirstSegment.FirstOccurrence.NewField; if TestHL7Message.FirstSegment.FirstOccurrence.FirstField = nil then fail('Field could not be created.') else TestHL7Message.FirstSegment.FirstOccurrence.FirstField.contentString := EXAMPLE_FIELD3; end; end; This strategy is even more flexible. Option 4: Gradually construct the message from components: var TestHL7Message: THL7Message; TestHL7Message := THL7Message.Create('2.5'); if TestHL7Message.NewSegment = nil then fail('Segment could not be created.') else begin TestHL7Message.FirstSegment.NewOccurrence(''); if TestHL7Message.FirstSegment.FirstOccurrence = nil then fail('Occurrence could not be created.') else begin TestHL7Message.FirstSegment.FirstOccurrence.NewField; if TestHL7Message.FirstSegment.FirstOccurrence.FirstField = nil then fail('Field could not be created.') else begin TestHL7Message.FirstSegment.FirstOccurrence.FirstField.NewComponent; if TestHL7Message.FirstSegment.FirstOccurrence.FirstField.FirstComponent = nil then fail('Component could not be created') else TestHL7Message.FirstSegment.FirstOccurrence.FirstField. FirstComponent.contentString := 'ROE^MARIE^^^^'; end; end; end; And, of course, option 5 constructs your message from sub-components: var TestHL7Message: THL7Message; TestHL7Message := THL7Message.Create('2.5'); TestHL7Message.AllocSegments('empty'); if TestHL7Message.FirstSegment = nil then fail('Segment could not be created.') else begin if TestHL7Message.FirstSegment.FirstOccurrence = nil then fail('Occurrence could not be created.'); end; begin if TestHL7Message.FirstSegment.FirstOccurrence.FirstField = nil then fail('Field could not be created.') else begin TestHL7Message .FirstSegment.FirstOccurrence.FirstField.AllocComponents(''); if TestHL7Message.FirstSegment.FirstOccurrence.FirstField.FirstComponent = nil then fail('Component could not be created') else begin TestHL7Message.FirstSegment.FirstOccurrence.FirstField. FirstComponent.NewSubComponent; if TestHL7Message.FirstSegment.FirstOccurrence.FirstField. FirstComponent.FirstSubComponent = nil then fail('Subcomponent could not be created') else TestHL7Message.FirstSegment.FirstOccurrence.FirstField. FirstComponent.contentString := 'Thomas&Gregory'; end; end; end; This is the most flexible way to do this. The examples contain "fail" functions for FPCUnit. In productivity code you might want to replace them by code that raises an exception, displays a dialog box, writes to a log file etc. Perhaps the best way to create a segment is to combine the options from above. The "PV1" unit uses the following code: procedure SetPV1(message: THL7message; PV1Record: tPV1); var newSegment: THL7Segment; FieldSep: char; theString: ansistring; begin FieldSep := message.Delimiters.FieldSeparator; newSegment := THL7Segment.Create(message, ''); with PV1Record do theString := PV1_ID + FieldSep + SetID + FieldSep + PatientClass + FieldSep + AssignedPatientLocation + FieldSep + AdmissionType + FieldSep + PreadmitNumber + FieldSep + PriorPatientLocation + FieldSep + AttendingDoctor + FieldSep + ReferringDoctor + FieldSep + ConsultingDoctor + FieldSep + HospitalService + FieldSep + TemporaryLocation + FieldSep + PreadmitTestIndicator + FieldSep + ReadmissionIndicator + FieldSep + AdmitSource + FieldSep + AmbulatoryStatus + FieldSep + VIPIndicator + FieldSep + AdmittingDoctor + FieldSep + PatientType + FieldSep + VisitNumber + FieldSep + FinancialClass + FieldSep + ChargePriceIndicator + FieldSep + CourtesyCode + FieldSep + CreditRate + FieldSep + ContractCode + FieldSep + ContractEffectiveDate + FieldSep + ContractAmount + FieldSep + ContractPeriod + FieldSep + InterestCode + FieldSep + TransferToBadDeptCode + FieldSep + TransferToBadDeptDate + FieldSep + BadDeptAgencyCode + FieldSep + BadDeptTransferAmount + FieldSep + BadDeptRecoveryAmount + FieldSep + DeleteAccountIndicator + FieldSep + DeleteAccountDate + FieldSep + DischargeDisposition + FieldSep + DischargedToLocation + FieldSep + DietType + FieldSep + ServicingFacility + FieldSep + BedStatus + FieldSep + AccountStatus + FieldSep + PendingLocation + FieldSep + PriorTemporaryLocation + FieldSep + AdmitDateTime + FieldSep + DischargeDateTime + FieldSep + CurrentPatientBalance + FieldSep + TotalCharges + FieldSep + TotalAdustments + FieldSep + TotalPayments + FieldSep + AlternateVisitID + FieldSep + VisitIndicator + FieldSep + OtherHealthcareProvider + FieldSep + FieldSep + ServiceEpisodeDescription + FieldSep + ServiceEpisodeID + FieldSep; newSegment.contentString := theString; message.AddSegment(newSegment); end; You may use this example to create an ORC segment. Of course you have to follow the syntax of the official HL7 definition for an ORC segment. Please don't hesitate to ask for more help. Good luck, J. W. D. Am 19.02.2015 um 20:41 schrieb Marek Skorupski: > Hi, > > I'm creating HL7 message and I need use some segments.I found PID, > PV1, > OBR units but I can't find ORC in HL7 engine. Is there any other way > to > read/write ORC? > -- > greetings > > Marek Skorupski > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and > Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & > more > Get technology previously reserved for billion-dollar corporations, > FREE > http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk > _______________________________________________ > Puma-repository-applications mailing list > Pum...@li... > https://lists.sourceforge.net/lists/listinfo/puma-repository-applications -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Dr. med. Johannes W. Dietrich -- Oberarzt / Consultant Endocrinologist -- Laboratory XU44, Endocrine Research -- Medical Hospital I, Bergmannsheil University Hospitals -- Ruhr University of Bochum -- Buerkle-de-la-Camp-Platz 1, D-44789 Bochum, NRW, Germany -- Phone: +49:234:302-6400, Fax: +49:234:302-6403 -- eMail: "j.w...@me..." -- WWW: http://www.thyreologie.com.de -- WWW: http://www.uk.rub.de -- Researcher ID: C-3498-2009 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- |
From: Marek S. <mar...@gm...> - 2015-02-19 19:41:51
|
Hi, I'm creating HL7 message and I need use some segments.I found PID, PV1, OBR units but I can't find ORC in HL7 engine. Is there any other way to read/write ORC? -- greetings Marek Skorupski |
From: Johannes W. D. <joh...@ru...> - 2015-02-07 11:54:47
|
Recently, version 4.0 of SPINA Thyr, a cross-platform application that facilitates calculation of thyroid's secretory capacity, total deiodinase activtiy and other structure parameters of thyroid homeostasis from hormone levels in equilibrium, has been released. Thanks to HL7 engine 1.6.1 the support of HL7 messages has been massively improved. SPINA Thyr has now been enabled to both import and export data as HL7 ORU^R01 messages, which also provides an easy way to store calculation results. In addition to laboratory results the new version is able to also embed patient identifiers and visit dates, a feature that improves both archiving, printing and interoperability with electronic health records and hospital information systems. SPINA Thyr 4.0 is available for free from http://spina.sf.net for Desktop Linux, Mac OS X and Windows. PUMA units may be freely obtained from http://puma-repository.sf.net for Lazarus / Free Pascal. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Dr. med. Johannes W. Dietrich -- Oberarzt / Consultant Endocrinologist -- Laboratory XU44, Endocrine Research -- Medical Hospital I, Bergmannsheil University Hospitals -- Ruhr University of Bochum -- Buerkle-de-la-Camp-Platz 1, D-44789 Bochum, NRW, Germany -- Phone: +49:234:302-6400, Fax: +49:234:302-6403 -- eMail: "j.w...@me..." -- WWW: http://www.thyreologie.com.de -- WWW: http://www.uk.rub.de -- Researcher ID: C-3498-2009 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- |
From: Johannes W. D. <joh...@ru...> - 2014-05-26 21:59:31
|
On occasion of the World Thyroid Day on May 25th, 2014, a new version of SimThyr has been released. SimThyr is open source software for simulation of thyroid homeostasis (hypothalamus-pituitary-thyroid feedback control). Version 3.3 of SimThyr adopts the most recent version of PUMA Unit Converter, which replaces an older custom solution in SimThyr. The PUMA module has been extensively tested and is regularly updated. Therefore, using the Unit Converter promises a higher reliability of the overall application. Conversely, special requirements of SimThyr, a computation-intensive application, necessitated the advancement of the Unit Converter. Due to SimThyr's needs it now introduced new functions for pre-calculating conversion factors for time-critical applications. SimThyr 3.3 is available for free from http://simthyr.sf.net for Linux, Mac OS X and Windows. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Dr. Johannes W. Dietrich, M.D. -- Oberarzt / Consultant Endocrinologist -- Laboratory XU44, Endocrine Research -- Medical Hospital I, Bergmannsheil University Hospitals -- Ruhr University of Bochum -- Buerkle-de-la-Camp-Platz 1, D-44789 Bochum, NRW, Germany -- Phone: +49:234:302-6400, Fax: +49:234:302-6403 -- eMail: "j.w...@me..." -- WWW: http://www.thyreologie.com.de -- WWW: http://www.uk.rub.de -- Researcher ID: C-3498-2009 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- |