You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
(4) |
May
(5) |
Jun
(6) |
Jul
(3) |
Aug
(13) |
Sep
(28) |
Oct
(33) |
Nov
(8) |
Dec
(1) |
2003 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(25) |
May
(21) |
Jun
(13) |
Jul
(12) |
Aug
(14) |
Sep
(6) |
Oct
(6) |
Nov
(16) |
Dec
(6) |
2004 |
Jan
(5) |
Feb
(7) |
Mar
(13) |
Apr
(17) |
May
(24) |
Jun
(14) |
Jul
(14) |
Aug
(8) |
Sep
(3) |
Oct
(8) |
Nov
(14) |
Dec
(26) |
2005 |
Jan
(18) |
Feb
(12) |
Mar
(29) |
Apr
(9) |
May
(4) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(12) |
Oct
|
Nov
(12) |
Dec
|
2006 |
Jan
(46) |
Feb
(18) |
Mar
(11) |
Apr
(13) |
May
(12) |
Jun
(27) |
Jul
(34) |
Aug
(45) |
Sep
(27) |
Oct
(13) |
Nov
(26) |
Dec
(22) |
2007 |
Jan
(21) |
Feb
(29) |
Mar
(32) |
Apr
(6) |
May
(11) |
Jun
(13) |
Jul
(14) |
Aug
(11) |
Sep
(15) |
Oct
(7) |
Nov
(30) |
Dec
(16) |
2008 |
Jan
(11) |
Feb
(14) |
Mar
(5) |
Apr
(18) |
May
(12) |
Jun
(11) |
Jul
(5) |
Aug
(12) |
Sep
(3) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
2009 |
Jan
(18) |
Feb
(6) |
Mar
(9) |
Apr
(10) |
May
(29) |
Jun
(16) |
Jul
(44) |
Aug
(49) |
Sep
(14) |
Oct
(21) |
Nov
(11) |
Dec
(22) |
2010 |
Jan
(12) |
Feb
(13) |
Mar
(5) |
Apr
(6) |
May
(15) |
Jun
(15) |
Jul
(14) |
Aug
(20) |
Sep
(17) |
Oct
(36) |
Nov
(19) |
Dec
(7) |
2011 |
Jan
(8) |
Feb
(14) |
Mar
(21) |
Apr
(12) |
May
(6) |
Jun
(12) |
Jul
(17) |
Aug
(6) |
Sep
(13) |
Oct
(15) |
Nov
(26) |
Dec
(9) |
2012 |
Jan
(25) |
Feb
(13) |
Mar
(31) |
Apr
(10) |
May
(16) |
Jun
(21) |
Jul
(61) |
Aug
(38) |
Sep
(16) |
Oct
(13) |
Nov
(37) |
Dec
(26) |
2013 |
Jan
(20) |
Feb
(26) |
Mar
(34) |
Apr
(32) |
May
(27) |
Jun
(56) |
Jul
(16) |
Aug
(38) |
Sep
(35) |
Oct
(17) |
Nov
(11) |
Dec
(7) |
2014 |
Jan
(36) |
Feb
(13) |
Mar
(25) |
Apr
|
May
(27) |
Jun
(33) |
Jul
(34) |
Aug
|
Sep
(4) |
Oct
(11) |
Nov
(42) |
Dec
(2) |
2015 |
Jan
(5) |
Feb
(6) |
Mar
(11) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(5) |
Sep
(5) |
Oct
(5) |
Nov
(8) |
Dec
(19) |
2016 |
Jan
(8) |
Feb
(12) |
Mar
(6) |
Apr
(5) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(9) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2017 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
(6) |
May
(8) |
Jun
(7) |
Jul
(14) |
Aug
(10) |
Sep
(6) |
Oct
(2) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
(9) |
Mar
(2) |
Apr
(3) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(8) |
Sep
(4) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
2019 |
Jan
(10) |
Feb
(2) |
Mar
(6) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2020 |
Jan
(9) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(9) |
Oct
(1) |
Nov
(11) |
Dec
|
2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2023 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(2) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
From: Christian O. <chr...@gm...> - 2015-11-16 14:23:08
|
In your case, nothing tells HAPI to instantiate a "PFM" message when it comes across a message with MFN^M01 in the MSH-9 field. This is the task of the so-called event map. It's a file located in the ca.uhn.hl7v2.parser.eventmap package and called <version>.properties (i.e. in your case "2.5.properties"). The file contains two columns: col 1 specifies the message structure and col 2 specifies the custom class that implements this structure. If there is no match, it falls back to the standard event map, instantiating a instance of ca.uhn.hl7v2.model.v25.message.MFN_M01, which gives you the ClassCastException. Check the existing HAPI structure libraries for these eventmap files. So you have two choices * rename the class com.msh.bgapp.hl7.custommodel.v25.message.PFM class to MFN_M01. You don't need an custom eventmap then. * add an event map file to your project that explicitly maps MFN_M01 to PFM I usually choose option 1 as it keeps the naming convention and also indicates in the class name what is replaced. Also note that you do not necessarily have to extend from the original message structure class. cheers Christian 2015-10-26 20:08 GMT+01:00 Davies, Brian <Bri...@mc...>: > Related to the previous issue, I get an exception when casting down to my > object which extends the MFN_M01 message. I am extending MFN_M01 because > this is specified in the message type field, so I’m unable to avoid it. I > am using the v25 libraries and JDK1.7 > > > > Exception in thread "main" *java.lang.ClassCastException*: > ca.uhn.hl7v2.model.v25.message.MFN_M01 cannot be cast to > com.msh.bgapp.hl7.custommodel.v25.message.PFM > > at com.msh.bgapp.hl7.custommodel.v25.message.PFM.main( > *PFM.java:106*) > > > > > > String HDR= > "MSH|^~\\&|DSF||Vendor||20150926151426||MFN^M01|610-100672|P|2.5\r" > > > > > > * public* *class* PFM *extends* MFN_M01 { > > *private* *static* *final* *long* *serialVersionUID* = > -6182782287494872212L; > > > > > > *public* PFM(ModelClassFactory theFactory) { > > *super*(theFactory); > > init(theFactory); > > } > > > > *private* *void* init(ModelClassFactory factory) { > > *try* { > > *this*.add(MSH.*class*, *true*, *false* > ); > > *this*.add(MFI.*class*, *false*, > *false*); > > *this*.add(MFE.*class*, *false*, > *false*); > > > > } *catch*(HL7Exception e) { > > *log*.error("Unexpected error creating PFM ,e); > > } > > } > > > > *public* MSH getMSH() { > > *return* getTyped("MSH", MSH.*class*); > > } > > > > > > > > > > > > > > *public* ZRQ getZRQ() { > > *return* (ZRQ)getTyped("ZRQ", ZRQ.*class*); > > } > > > > *public* String getVersion() { > > *return* "2.5"; > > } > > > > > > > > > > > > > > *public* *static* *void* main(String[] args) *throws* > DataTypeException, HL7Exception, IOException { > > > > String HDR= > "MSH|^~\\&|DSF||Vendor||20150926151426||MFN^M01|610-100672|P|2.5\r" > > +"MFI|ZBM||UPD|20150917172522|20150917172522|AL\r" > > +"MFE|MAD|610-100672|20150917172522|610-100672|CE\r" > > > > ModelClassFactory cmf = *new* CustomModelClassFactory( > "com.msh.bgapp.hl7.custommodel"); > > @SuppressWarnings("resource") > > HapiContext context=*new* DefaultHapiContext(cmf); > > Parser parser = context.getPipeParser(); > > PFM o=(PFM)parser.parse(HDR); > > > > > > > > } > > > > } > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > |
From: Christian O. <chr...@gm...> - 2015-11-16 13:51:46
|
That's because in Java you cannot cast a Type[] into a ST[] (although you can cast a Type into a ST). There are some convenience methods in the superclass: return getTypedField(1, new ST[0]); // Alternatively use Arrays.copyOf // instead of return (ST[]) super.getField(1); return getTypedField(2, 0); // instead of return (NM) super.getField(1, 0); cheers Christian 2015-10-26 18:53 GMT+01:00 Davies, Brian <Bri...@mc...>: > I have the following 2 classes which seem to conform to the expected setup > for a custom model. I stripped the jars referenced in the project to just > the log4j and slf4j and the hapi-structures-v25-2.2.jar and > hapi-base-2.2.jar. It is more or less the same code as in the examples. I > tried doing this because I was getting a similar exception the core project > so I decided to strip it down to the bare minimum. I am also using JDK.1.7. > Any help would be most welcome. > > > > However, I am getting a ClassCastException : > > > > log4j:WARN Please initialize the log4j system properly. > > log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for > more info. > > Fido > > Fred > > 13 > > Exception in thread "main" *java.lang.ClassCastException*: > [Lca.uhn.hl7v2.model.Type; cannot be cast to [ > Lca.uhn.hl7v2.model.v25.datatype.ST; > > at com.msh.bgapp.hl7.custommodel.v25.segment.ZPI.getPetName( > *ZPI.java:49*) > > at com.msh.bgapp.hl7.TestCustomModel.main(*TestCustomModel.java:42* > ) > > > > > > package com.msh.bgapp.hl7.custommodel.v25.segment; > > > > import ca.uhn.hl7v2.HL7Exception; > > import ca.uhn.hl7v2.model.AbstractSegment; > > import ca.uhn.hl7v2.model.Group; > > import ca.uhn.hl7v2.model.Message; > > import ca.uhn.hl7v2.model.Type; > > import ca.uhn.hl7v2.model.v25.datatype.NM; > > import ca.uhn.hl7v2.model.v25.datatype.ST; > > import ca.uhn.hl7v2.parser.ModelClassFactory; > > > > > > > > public class ZPI extends AbstractSegment { > > private static final long serialVersionUID = 1L; > > > > public ZPI(Group parent, ModelClassFactory modelClassFactory) > > throws HL7Exception > > { > > super(parent, modelClassFactory); > > > > Message message = getMessage(); > > > > Class<? extends Type> type = ST.class; > > boolean required = true; > > int maxReps = 0; > > int maxLength = 100; > > Object[] constructorArgs = { message }; > > String fieldName = "Pet Name(s)"; > > add(type, required, maxReps, maxLength, constructorArgs, > fieldName); > > > > type = NM.class; > > required = false; > > maxReps = 1; > > maxLength = 4; > > constructorArgs = new Object[] { message }; > > fieldName = "Shoe Size"; > > add(type, required, maxReps, maxLength, constructorArgs, > fieldName); > > } > > > > protected Type createNewTypeWithoutReflection(int field) > > { > > return null; > > } > > > > public ST[] getPetName() > > throws HL7Exception > > { > > return (ST[])super.getField(1); > > } > > > > public NM getShoeSize() > > throws HL7Exception > > { > > return (NM)super.getField(1, 0); > > } > > } > > > > > > *package* com.msh.bgapp.hl7; > > > > *import* com.msh.bgapp.hl7.custommodel.v25.message.ZDT_A01; > > *import* com.msh.bgapp.hl7.custommodel.v25.segment.ZPI; > > *import* ca.uhn.hl7v2.HL7Exception; > > *import* ca.uhn.hl7v2.model.Segment; > > *import* ca.uhn.hl7v2.model.v25.message.ADT_A01; > > *import* ca.uhn.hl7v2.parser.CustomModelClassFactory; > > *import* ca.uhn.hl7v2.parser.ModelClassFactory; > > *import* ca.uhn.hl7v2.parser.Parser; > > *import* ca.uhn.hl7v2.parser.PipeParser; > > > > *public* *class* TestCustomModel { > > *public* *static* *void* main(String[] args) > > *throws* HL7Exception > > { > > String messageText = "MSH|^~\\&|IRIS|SANTER|AMB_R|SANTER|200803051508||ADT^A01|263206|P|2.5\rEVN||200803051509||||200803031508\rPID|||5520255^^^PK^PK~ZZZZZZ83M64Z148R^^^CF^CF~ZZZZZZ83M64Z148R^^^SSN^SSN^^20070103^99991231~^^^^TEAM||ZZZ^ZZZ||19830824|F||||||||||||||||||||||N\rZPI|Fido~Fred|13\rPV1||I|6402DH^^^^^^^^MED. > 1 - ONCOLOGIA^^OSPEDALE MAGGIORE DI LODI&LODI|||^^^^^^^^^^OSPEDALE MAGGIORE > DI > LODI&LODI|13936^TEST^TEST||||||||||5068^TEST2^TEST2||2008003369||||||||||||||||||||||||||200803031508\rPR1|1||1111^Mastoplastica|Protesi|20090224|02|" > ; > > > > ADT_A01 message = (ADT_A01)*new* PipeParser().parse( > messageText); > > > > Segment zpiGenericSegment = (Segment)message.get("ZPI"); > > > > String firstPetName = zpiGenericSegment.getField(1, > 0).encode(); > > String secondPetName = zpiGenericSegment.getField(1, > 1).encode(); > > System.*out*.println(firstPetName); > > System.*out*.println(secondPetName); > > > > String shoeSize = zpiGenericSegment.getField(2, > 0).encode(); > > System.*out*.println(shoeSize); > > > > ModelClassFactory cmf = *new* CustomModelClassFactory( > "com.msh.bgapp.hl7.custommodel"); > > > > Parser parser = *new* PipeParser(cmf); > > > > messageText = "MSH|^~\\&|IRIS|SANTER|AMB_R|SANTER|200803051508||ZDT^A01|263206|P|2.5\rEVN||200803051509||||200803031508\rPID|||5520255^^^PK^PK~ZZZZZZ83M64Z148R^^^CF^CF~ZZZZZZ83M64Z148R^^^SSN^SSN^^20070103^99991231~^^^^TEAM||ZZZ^ZZZ||19830824|F||||||||||||||||||||||N\rZPI|Fido~Fred|13\rPV1||I|6402DH^^^^^^^^MED. > 1 - ONCOLOGIA^^OSPEDALE MAGGIORE DI LODI&LODI|||^^^^^^^^^^OSPEDALE MAGGIORE > DI > LODI&LODI|13936^TEST^TEST||||||||||5068^TEST2^TEST2||2008003369||||||||||||||||||||||||||200803031508\rPR1|1||1111^Mastoplastica|Protesi|20090224|02|" > ; > > > > ZDT_A01 zdtA01 = (ZDT_A01)parser.parse(messageText); > > > > ZPI zpi = zdtA01.getZPI(); > > > > System.*out*.println(zpi.getPetName()[0].encode()); > > System.*out*.println(zpi.getPetName()[1].encode()); > > System.*out*.println(zpi.getShoeSize().encode()); > > } > > } > > > > package com.msh.bgapp.hl7.custommodel.v25.message; > > > > > > import ca.uhn.hl7v2.HL7Exception; > > import ca.uhn.hl7v2.model.v25.message.ADT_A01; > > import ca.uhn.hl7v2.parser.ModelClassFactory; > > import java.util.Arrays; > > > > import com.msh.bgapp.hl7.custommodel.v25.segment.ZPI; > > > > > > public class ZDT_A01 extends ADT_A01 { > > > > private static final long serialVersionUID = -2504830694193741286L; > > > > public ZDT_A01(ModelClassFactory factory) > > throws HL7Exception > > { > > super(factory); > > > > String[] segmentNames = getNames(); > > int indexOfPid = > Arrays.asList(segmentNames).indexOf("PID"); > > > > Class<ZPI> type = ZPI.class; > > boolean required = true; > > boolean repeating = false; > > int index = indexOfPid + 1; > > > > add(type, required, repeating, index); > > } > > > > public ZPI getZPI() > > throws HL7Exception > > { > > return (ZPI)get("ZPI"); > > } > > } > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > |
From: Ian V. <Ian...@he...> - 2015-11-08 21:35:42
|
The MSH-9 field needs the second component to cope. Try with (guessing you want an R01): MSH|^~\&|harvest|harvest|harvest|harvest|20151106111919||ORU^R01|37037|P|2.3| Hope this helps Ian From: John Giotta [mailto:jdg...@gm...] Sent: Sunday, 8 November 2015 5:14 AM To: hl7...@li... Subject: [HAPI-devel] Trying to determine the issue with Result Message I'm new to using HAPI and I'm trying to parse an ORU sample message. I'm not having any luck. I keep getting the following message: "Can't determine message structure from MSH-9: ORU HINT: there are only 1 of 3 components present" This is my MSH segment: "MSH|^~\&|harvest|harvest|harvest|harvest|20151106111919||ORU|37037|P|2.3|" What can possibly be wrong with the sample message? ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. ********************************************************************************** |
From: John G. <jdg...@gm...> - 2015-11-07 19:14:18
|
I'm new to using HAPI and I'm trying to parse an ORU sample message. I'm not having any luck. I keep getting the following message: "Can't determine message structure from MSH-9: ORU HINT: there are only 1 of 3 components present" This is my MSH segment: "MSH|^~\&|harvest|harvest|harvest|harvest|20151106111919||ORU|37037|P|2.3|" What can possibly be wrong with the sample message? |
From: Davies, B. <Bri...@Mc...> - 2015-10-27 14:36:00
|
I am extending the MFN_M01 message as this is provided by a 3rd party to an app that I am working on. I extended the MFN_M01 class for example: DCS,RXD and MTN extend AbstractGroup and in a package com.mypackage. sbs.v25.group. However, none of DCS,RXD or MTN are loaded in the custom model, even though the custom segments are loaded when encountered by the parser. I adopted HAPI because I wanted to replace the home grown implementation being used but unfortunately encountering numerous issues. Casting the class to TFM also results in a class cast exception because the message type/trigger, field 9 is MFN_M01. public class TFM extends MFN_M01 { public TFM(ModelClassFactory theFactory) { super(theFactory); init(theFactory); } private void init(ModelClassFactory factory) { try { this.add(DCS.class, true, false); this.add(RXD.class, true, true,false); this.add(MTN.class, true, true,false); } catch(HL7Exception e) { log.error("Unexpected error creating TFM", e); } } Best Regards. |
From: Davies, B. <Bri...@Mc...> - 2015-10-26 19:08:32
|
Related to the previous issue, I get an exception when casting down to my object which extends the MFN_M01 message. I am extending MFN_M01 because this is specified in the message type field, so I'm unable to avoid it. I am using the v25 libraries and JDK1.7 Exception in thread "main" java.lang.ClassCastException: ca.uhn.hl7v2.model.v25.message.MFN_M01 cannot be cast to com.msh.bgapp.hl7.custommodel.v25.message.PFM at com.msh.bgapp.hl7.custommodel.v25.message.PFM.main(PFM.java:106) String HDR="MSH|^~\\&|DSF||Vendor||20150926151426||MFN^M01|610-100672|P|2.5\r" public class PFM extends MFN_M01 { private static final long serialVersionUID = -6182782287494872212L; public PFM(ModelClassFactory theFactory) { super(theFactory); init(theFactory); } private void init(ModelClassFactory factory) { try { this.add(MSH.class, true, false); this.add(MFI.class, false, false); this.add(MFE.class, false, false); } catch(HL7Exception e) { log.error("Unexpected error creating PFM ,e); } } public MSH getMSH() { return getTyped("MSH", MSH.class); } public ZRQ getZRQ() { return (ZRQ)getTyped("ZRQ", ZRQ.class); } public String getVersion() { return "2.5"; } public static void main(String[] args) throws DataTypeException, HL7Exception, IOException { String HDR="MSH|^~\\&|DSF||Vendor||20150926151426||MFN^M01|610-100672|P|2.5\r" +"MFI|ZBM||UPD|20150917172522|20150917172522|AL\r" +"MFE|MAD|610-100672|20150917172522|610-100672|CE\r" ModelClassFactory cmf = new CustomModelClassFactory("com.msh.bgapp.hl7.custommodel"); @SuppressWarnings("resource") HapiContext context=new DefaultHapiContext(cmf); Parser parser = context.getPipeParser(); PFM o=(PFM)parser.parse(HDR); } } |
From: Davies, B. <Bri...@Mc...> - 2015-10-26 17:54:10
|
I have the following 2 classes which seem to conform to the expected setup for a custom model. I stripped the jars referenced in the project to just the log4j and slf4j and the hapi-structures-v25-2.2.jar and hapi-base-2.2.jar. It is more or less the same code as in the examples. I tried doing this because I was getting a similar exception the core project so I decided to strip it down to the bare minimum. I am also using JDK.1.7. Any help would be most welcome. However, I am getting a ClassCastException : log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Fido Fred 13 Exception in thread "main" java.lang.ClassCastException: [Lca.uhn.hl7v2.model.Type; cannot be cast to [Lca.uhn.hl7v2.model.v25.datatype.ST; at com.msh.bgapp.hl7.custommodel.v25.segment.ZPI.getPetName(ZPI.java:49) at com.msh.bgapp.hl7.TestCustomModel.main(TestCustomModel.java:42) package com.msh.bgapp.hl7.custommodel.v25.segment; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.AbstractSegment; import ca.uhn.hl7v2.model.Group; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.Type; import ca.uhn.hl7v2.model.v25.datatype.NM; import ca.uhn.hl7v2.model.v25.datatype.ST; import ca.uhn.hl7v2.parser.ModelClassFactory; public class ZPI extends AbstractSegment { private static final long serialVersionUID = 1L; public ZPI(Group parent, ModelClassFactory modelClassFactory) throws HL7Exception { super(parent, modelClassFactory); Message message = getMessage(); Class<? extends Type> type = ST.class; boolean required = true; int maxReps = 0; int maxLength = 100; Object[] constructorArgs = { message }; String fieldName = "Pet Name(s)"; add(type, required, maxReps, maxLength, constructorArgs, fieldName); type = NM.class; required = false; maxReps = 1; maxLength = 4; constructorArgs = new Object[] { message }; fieldName = "Shoe Size"; add(type, required, maxReps, maxLength, constructorArgs, fieldName); } protected Type createNewTypeWithoutReflection(int field) { return null; } public ST[] getPetName() throws HL7Exception { return (ST[])super.getField(1); } public NM getShoeSize() throws HL7Exception { return (NM)super.getField(1, 0); } } package com.msh.bgapp.hl7; import com.msh.bgapp.hl7.custommodel.v25.message.ZDT_A01; import com.msh.bgapp.hl7.custommodel.v25.segment.ZPI; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.Segment; import ca.uhn.hl7v2.model.v25.message.ADT_A01; import ca.uhn.hl7v2.parser.CustomModelClassFactory; import ca.uhn.hl7v2.parser.ModelClassFactory; import ca.uhn.hl7v2.parser.Parser; import ca.uhn.hl7v2.parser.PipeParser; public class TestCustomModel { public static void main(String[] args) throws HL7Exception { String messageText = "MSH|^~\\&|IRIS|SANTER|AMB_R|SANTER|200803051508||ADT^A01|263206|P|2.5\rEVN||200803051509||||200803031508\rPID|||5520255^^^PK^PK~ZZZZZZ83M64Z148R^^^CF^CF~ZZZZZZ83M64Z148R^^^SSN^SSN^^20070103^99991231~^^^^TEAM||ZZZ^ZZZ||19830824|F||||||||||||||||||||||N\rZPI|Fido~Fred|13\rPV1||I|6402DH^^^^^^^^MED. 1 - ONCOLOGIA^^OSPEDALE MAGGIORE DI LODI&LODI|||^^^^^^^^^^OSPEDALE MAGGIORE DI LODI&LODI|13936^TEST^TEST||||||||||5068^TEST2^TEST2||2008003369||||||||||||||||||||||||||200803031508\rPR1|1||1111^Mastoplastica|Protesi|20090224|02|"; ADT_A01 message = (ADT_A01)new PipeParser().parse(messageText); Segment zpiGenericSegment = (Segment)message.get("ZPI"); String firstPetName = zpiGenericSegment.getField(1, 0).encode(); String secondPetName = zpiGenericSegment.getField(1, 1).encode(); System.out.println(firstPetName); System.out.println(secondPetName); String shoeSize = zpiGenericSegment.getField(2, 0).encode(); System.out.println(shoeSize); ModelClassFactory cmf = new CustomModelClassFactory("com.msh.bgapp.hl7.custommodel"); Parser parser = new PipeParser(cmf); messageText = "MSH|^~\\&|IRIS|SANTER|AMB_R|SANTER|200803051508||ZDT^A01|263206|P|2.5\rEVN||200803051509||||200803031508\rPID|||5520255^^^PK^PK~ZZZZZZ83M64Z148R^^^CF^CF~ZZZZZZ83M64Z148R^^^SSN^SSN^^20070103^99991231~^^^^TEAM||ZZZ^ZZZ||19830824|F||||||||||||||||||||||N\rZPI|Fido~Fred|13\rPV1||I|6402DH^^^^^^^^MED. 1 - ONCOLOGIA^^OSPEDALE MAGGIORE DI LODI&LODI|||^^^^^^^^^^OSPEDALE MAGGIORE DI LODI&LODI|13936^TEST^TEST||||||||||5068^TEST2^TEST2||2008003369||||||||||||||||||||||||||200803031508\rPR1|1||1111^Mastoplastica|Protesi|20090224|02|"; ZDT_A01 zdtA01 = (ZDT_A01)parser.parse(messageText); ZPI zpi = zdtA01.getZPI(); System.out.println(zpi.getPetName()[0].encode()); System.out.println(zpi.getPetName()[1].encode()); System.out.println(zpi.getShoeSize().encode()); } } package com.msh.bgapp.hl7.custommodel.v25.message; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.v25.message.ADT_A01; import ca.uhn.hl7v2.parser.ModelClassFactory; import java.util.Arrays; import com.msh.bgapp.hl7.custommodel.v25.segment.ZPI; public class ZDT_A01 extends ADT_A01 { private static final long serialVersionUID = -2504830694193741286L; public ZDT_A01(ModelClassFactory factory) throws HL7Exception { super(factory); String[] segmentNames = getNames(); int indexOfPid = Arrays.asList(segmentNames).indexOf("PID"); Class<ZPI> type = ZPI.class; boolean required = true; boolean repeating = false; int index = indexOfPid + 1; add(type, required, repeating, index); } public ZPI getZPI() throws HL7Exception { return (ZPI)get("ZPI"); } } |
From: Christian O. <chr...@gm...> - 2015-10-23 08:04:17
|
You need to obtain the PipeParser from the HapiContext where you attached the ModelClassFactory to. ModelClassFactory cfm=*new* CustomModelClassFactory("com.hss.customodel"); HapiContext context=*new* DefaultHapiContext(cfm); Parser pipeParser = context.getPipeParser(); Message m=pipeParser.parse(ackMessageString); System.*out*.println("My message is "+m.printStructure()); Now the Parser should use your custom structures. Christian 2015-10-22 17:05 GMT+02:00 Davies, Brian <Bri...@mc...>: > I am using the HAPI version 2.5 library. > > //instantiate a PipeParser, which handles the "traditional encoding" > > ModelClassFactory cfm=*new* CustomModelClassFactory( > "com.hss.customodel"); > > Parser pipeParser = *new* PipeParser(cfm); > > *int* count=0; > > HapiContext context=*new* DefaultHapiContext(cfm); > > context.setModelClassFactory(cfm); > > *try*{ > > Message m=pipeParser.parse(ackMessageString); > > System.*out*.println("My message is "+m.printStructure()); > > > > }*catch*(Exception e){ > > e.printStackTrace(); > > } > > > > The logs show that the DefaultModelFactory is being used instead of the > CustomModelFactory. Further proof is that I can change the package name to > one that doesn’t exist with no exceptions thrown. > > > > > > Here is a sample of the log output: > > > > 10:03:20,649 DEBUG [main] DefaultModelClassFactory:330 - Loaded: > ca.uhn.hl7v2.model.v25.message.MFN_M01 class: class > ca.uhn.hl7v2.model.v25.message.MFN_M01 > > 10:03:20,696 DEBUG [main] MessageIterator:178 - Creating non standard > segment ZP1 on group: MF > > 10:03:20,696 DEBUG [main] DefaultModelClassFactory:326 - Trying to load: > ca.uhn.hl7v2.model.v25.segment.ZP1 > > 10:03:20,696 DEBUG [main] DefaultModelClassFactory:334 - Failed to load: > ca.uhn.hl7v2.model.v25.segment.ZP1 > > > > > > Many thanks. > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > |
From: Davies, B. <Bri...@Mc...> - 2015-10-22 15:26:51
|
I am using the HAPI version 2.5 library. //instantiate a PipeParser, which handles the "traditional encoding" ModelClassFactory cfm=new CustomModelClassFactory("com.hss.customodel"); Parser pipeParser = new PipeParser(cfm); int count=0; HapiContext context=new DefaultHapiContext(cfm); context.setModelClassFactory(cfm); try{ Message m=pipeParser.parse(ackMessageString); System.out.println("My message is "+m.printStructure()); }catch(Exception e){ e.printStackTrace(); } The logs show that the DefaultModelFactory is being used instead of the CustomModelFactory. Further proof is that I can change the package name to one that doesn't exist with no exceptions thrown. Here is a sample of the log output: 10:03:20,649 DEBUG [main] DefaultModelClassFactory:330 - Loaded: ca.uhn.hl7v2.model.v25.message.MFN_M01 class: class ca.uhn.hl7v2.model.v25.message.MFN_M01 10:03:20,696 DEBUG [main] MessageIterator:178 - Creating non standard segment ZP1 on group: MF 10:03:20,696 DEBUG [main] DefaultModelClassFactory:326 - Trying to load: ca.uhn.hl7v2.model.v25.segment.ZP1 10:03:20,696 DEBUG [main] DefaultModelClassFactory:334 - Failed to load: ca.uhn.hl7v2.model.v25.segment.ZP1 Many thanks. |
From: Jens V. <jen...@gm...> - 2015-09-29 20:18:53
|
Latest HAPI release is v2.2 and was back in 2014. v1.1 was released back in 2011. I would be surprised if anyone would be able to remember such a gap. On 29 September 2015 at 11:05, Jasmine Piacenti < jas...@sy...> wrote: > Hi, > > I’m testing the follow message > > > MSH|^~\&|VERBENA|PRAEZISION|RIS|SYNCROMED|20070828135556+0000||ORM^O01^ORM_O01|5366|P|2.5| > > PID|||19930013050^^^PK^PK^^^^^^~CODSTP^^^STP^STP~CODFISC^^^CF^CF~TEsSan^^^TS^TS||PROVACOGN^PROVANOME^^^^^L^^^^^^^||19361027|M|||VIA > MASCAGNI 5^^URUGUAY^null^37014^^C^^999618^^^^^~VIA MASCAGNI > 5^^URUGUAY^null^37014^^H^^999618^^^^^~^^URUGUAY^null^37014^^BR^^999618^^^^^|||||||GLLCLS36R24Z613E|611281734|||||||||||||||||||| > > PD1|||ASL DELLA PROVINCIA DI BERGAMO^^^^^^H^^^301030~ASL > ASS^^^^^^C^^^123456| > > > PV1||E|||||133429^COGN^NOME|9PRZMARK^COGNOME^NOME^^^^^^^^^^9||114|||||||||589179|||||||||||||||||||||||A02|||||||||V| > > ORC|NW|67262|5189|2007100059|PR||1^^^20070828135500+0000||20070828135500+0000|||9PRZMARK^COGNOME^NOME|||||114^PRONTO > SOCCORSO| > > OBR|1|67262|5189|1223^RX PELVI > (bacino)||||||||3|RRR|||9PRZMARK^COGNOME||||||||1|||1^^^20070828135500+0000| > > OBR|2|67262|5189|1223^RX PELVI > (bacino)||||||||3|RRR|||9PRZMARK^COGNOME||||||||1|||1^^^20070828135500+0000| > > OBX||FT|600936542||testo del referto | > > ORC|NW|67262|5190|2007100059|PR||1^^^20070828135500+0000||20070828135500+0000|||9PRZMARK^COGNOME^NOME|||||114^PRONTO > SOCCORSO| > > OBR|1|67262|5190|8001^TAC > CAPO||||||||3|RRR|||9PRZMARK^COGNOME||||||||7|||1^^^20070828135500+0000| > > OBR|2|67262|5190|8001^TAC > CAPO||||||||3|RRR|||9PRZMARK^COGNOME||||||||7|||1^^^20070828135500+0000| > > OBX||FT|600936542||testo del referto | > > ZDS|1.2.300.4005|a^b^c|Application|DICOM| > > > > With HAPI 0.6 when I parsed an ORM message with more than one OBR for one > ORC, I received an HL7Exception, like that: > > *HL7Exception arising from bad index: Error! Segment: OBR* > > *Either:* > > *a)The segment is in the wrong position * > > *b)More than 1 instance exists and the Segment is non-repetitional.* > > > > With HAPI 1.1 any exception is caught. > > Could you explain me why? > > With the next versions (after 1.1) this behaviour remains the same or > changes? > > > > Thank you > > Regards > > > > Jasmine Piacenti > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- Med venlig hilsen / Kind regards *Jens Kristian Villadsen* cand.polyt Stålhøjen 24 8240 Risskov Denmark Mobile +4523373806 jen...@gm... |
From: Jasmine P. <jas...@sy...> - 2015-09-29 09:05:44
|
Hi, I'm testing the follow message MSH|^~\&|VERBENA|PRAEZISION|RIS|SYNCROMED|20070828135556+0000||ORM^O01^ORM_O 01|5366|P|2.5| PID|||19930013050^^^PK^PK^^^^^^~CODSTP^^^STP^STP~CODFISC^^^CF^CF~TEsSan^^^TS ^TS||PROVACOGN^PROVANOME^^^^^L^^^^^^^||19361027|M|||VIA MASCAGNI 5^^URUGUAY^null^37014^^C^^999618^^^^^~VIA MASCAGNI 5^^URUGUAY^null^37014^^H^^999618^^^^^~^^URUGUAY^null^37014^^BR^^999618^^^^^| ||||||GLLCLS36R24Z613E|611281734|||||||||||||||||||| PD1|||ASL DELLA PROVINCIA DI BERGAMO^^^^^^H^^^301030~ASL ASS^^^^^^C^^^123456| PV1||E|||||133429^COGN^NOME|9PRZMARK^COGNOME^NOME^^^^^^^^^^9||114|||||||||58 9179|||||||||||||||||||||||A02|||||||||V| ORC|NW|67262|5189|2007100059|PR||1^^^20070828135500+0000||20070828135500+000 0|||9PRZMARK^COGNOME^NOME|||||114^PRONTO SOCCORSO| OBR|1|67262|5189|1223^RX PELVI (bacino)||||||||3|RRR|||9PRZMARK^COGNOME||||||||1|||1^^^20070828135500+0000| OBR|2|67262|5189|1223^RX PELVI (bacino)||||||||3|RRR|||9PRZMARK^COGNOME||||||||1|||1^^^20070828135500+0000| OBX||FT|600936542||testo del referto | ORC|NW|67262|5190|2007100059|PR||1^^^20070828135500+0000||20070828135500+000 0|||9PRZMARK^COGNOME^NOME|||||114^PRONTO SOCCORSO| OBR|1|67262|5190|8001^TAC CAPO||||||||3|RRR|||9PRZMARK^COGNOME||||||||7|||1^^^20070828135500+0000| OBR|2|67262|5190|8001^TAC CAPO||||||||3|RRR|||9PRZMARK^COGNOME||||||||7|||1^^^20070828135500+0000| OBX||FT|600936542||testo del referto | ZDS|1.2.300.4005|a^b^c|Application|DICOM| With HAPI 0.6 when I parsed an ORM message with more than one OBR for one ORC, I received an HL7Exception, like that: HL7Exception arising from bad index: Error! Segment: OBR Either: a)The segment is in the wrong position b)More than 1 instance exists and the Segment is non-repetitional. With HAPI 1.1 any exception is caught. Could you explain me why? With the next versions (after 1.1) this behaviour remains the same or changes? Thank you Regards Jasmine Piacenti |
From: Jeremy H. <jer...@ka...> - 2015-09-14 21:32:27
|
Hi all, We're in the process of upgrading from hapi 1.2 to 2.2. With 1.2, we used to be able to call Socket.setSOTimeout() and when that timeout tripped, the connection using the socket would nicely shut down. 2.2 seems to catch the exception, ignore it and keep on going. Is there some other mechanism we can use to automatically shut down a connection after a certain period of inactivity? We need this functionality to prevent leaks in our hl7 servers in environments where clients crash or firewalls silently drop connections. I'd be happy to submit a patch but would want some feedback first. Would it be acceptable to close the connection when a SocketTimeoutException happens? Are there legitimate use cases for triggering and then recovering from a timeout? Jeremy Huiskamp | karoshealth Software Engineer 7 Father David Bauer Drive, Suite 201 Waterloo, ON, N2L 0A2, Canada www.karoshealth.com |
From: Jens V. <jen...@gm...> - 2015-09-05 20:09:34
|
Not that it helps your situation - but here is a list over more forbidden names: https://support.microsoft.com/en-us/kb/74496 On 5 September 2015 at 08:03, Andrew Bowden <And...@rc...> wrote: > I’m trying to integrate with a third party system that is using CON > segments in ADT messages. These are 2.5 message structures and I have > found that the library has a shell for this in the CON_ segment type ( > http://hl7api.sourceforge.net/v251/apidocs/ca/uhn/hl7v2/model/v251/segment/CON_.html) > > > > > When I instantiate this class by extending the ADT_A01 message type, with > a > > this.add(ca.uhn.hl7v2.model.v25.segment.CON_.class, false, false, > indexOfPID+2); > > in the constructor or > > this.add(au.org.rch.custom.v25.segment.TST.class, false, > false, indexOfPID+1); > > > > This results in a printStructure that looks reasonable: > > > > MSH - > MSH|^~\&|xxx|xxx|xxx|xxx|20150604160029||ADT^A01^ADT_A01|xxxx|T|2.4|||AL|NE|AUS||en^^ISO > 639-1 > > EVN - EVN|A01|20150604155951 > > PID - PID|||xxxxx||||||| > > [ TST ] - TST||adf|||||||||||||||||||Y > > [ CON_ ] - CON_ > > [ PD1 ] - PD1 > > > > The problem that I’m struggling with is that the segment is incorrectly > named either CON_ or TST. This is due to a limitation in the windows file > system not allowing the filename to be CON.java which I believe would then > name the segment correctly. > > > > I’ve been parsing the code to try to understand where this is set but I > can’t seem to find the correct way to change this. Has anyone else tried > to set the name of the segment to be different to the class name and if so, > how can I do this? > > > > Thanks for reading through this and any help would be appreciated. > > > > Andrew > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- Med venlig hilsen / Kind regards *Jens Kristian Villadsen* cand.polyt Stålhøjen 24 8240 Risskov Denmark Mobile +4523373806 jen...@gm... |
From: Andrew B. <And...@rc...> - 2015-09-05 06:31:26
|
I'm trying to integrate with a third party system that is using CON segments in ADT messages. These are 2.5 message structures and I have found that the library has a shell for this in the CON_ segment type (http://hl7api.sourceforge.net/v251/apidocs/ca/uhn/hl7v2/model/v251/segment/CON_.html) When I instantiate this class by extending the ADT_A01 message type, with a this.add(ca.uhn.hl7v2.model.v25.segment.CON_.class, false, false, indexOfPID+2); in the constructor or this.add(au.org.rch.custom.v25.segment.TST.class, false, false, indexOfPID+1); This results in a printStructure that looks reasonable: MSH - MSH|^~\&|xxx|xxx|xxx|xxx|20150604160029||ADT^A01^ADT_A01|xxxx|T|2.4|||AL|NE|AUS||en^^ISO 639-1 EVN - EVN|A01|20150604155951 PID - PID|||xxxxx||||||| [ TST ] - TST||adf|||||||||||||||||||Y [ CON_ ] - CON_ [ PD1 ] - PD1 The problem that I'm struggling with is that the segment is incorrectly named either CON_ or TST. This is due to a limitation in the windows file system not allowing the filename to be CON.java which I believe would then name the segment correctly. I've been parsing the code to try to understand where this is set but I can't seem to find the correct way to change this. Has anyone else tried to set the name of the segment to be different to the class name and if so, how can I do this? Thanks for reading through this and any help would be appreciated. Andrew |
From: Ian V. <Ian...@he...> - 2015-08-21 01:49:31
|
Thanks to help from this list in the past we have been able to apply our own local implementation of HL7 escaping effectively to a hapi context. Recently we have been updating our application specific message formats, and realised we had not added our HL7 escaping implementation. We have succeeded in adding it using code like this: public class LAB_ORM_ORU extends AbstractMessage { private static final ModelClassFactory mcf = new DefaultModelClassFactory(); public LAB_ORM_ORU() throws HL7Exception { this(mcf); } public LAB_ORM_ORU(ModelClassFactory factory) throws HL7Exception { super(factory); this.addSegments(); this.attachEscapingParser(); } private void addSegments() throws HL7Exception { Class<MSH> addMsh = MSH.class; this.add(addMsh, true, false); Class<EVN> addEvn = EVN.class; this.add(addEvn, false, false); Class<NTE> addNte = NTE.class; this.add(addNte, false, true); Class<PATIENT> addPat = PATIENT.class; this.add(addPat, false, false); Class<ZMV> addZmv = ZMV.class; this.add(addZmv, false, false); Class<ZRC> addZRCs = ZRC.class; this.add(addZRCs, false, true); Class<ORDER_OBSERVATION> addObsGroup = ORDER_OBSERVATION.class; this.add(addObsGroup, true, true); } private void attachEscapingParser() { ParserConfiguration parserConfiguration = new ParserConfiguration(); parserConfiguration.setEscaping(new EscapingQhImpl()); getParser().setParserConfiguration(parserConfiguration); } . . . } However, in the attachEscapingParser method, the use of the .setParserConfiguration method is deprecated. Can anyone suggest how this could be done avoiding deprecated methods? Thanks Ian Systems Integration Team Queensland Department of Health Australia ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. ********************************************************************************** |
From: Ian V. <Ian...@he...> - 2015-08-17 01:55:01
|
Ashutosh sent this question to me directly, but included the message he was dealing with complete. Given the MSH I was able to ascertain that the message said it was HL7 version 2.2, and this resulted in the XML representation matching closer with the standard (no PID-3 lists catered for, repeating telephone numbers of TN type, not XTN which has additional components), than what is available in the parsed object. Extra components and the like don't end up in the XML when you use a simple context. There may be more options to adjust this in the XML representation of such things, but I'm not dealing with the XML representation every day. Is anyone else able to comment? Thanks Ian Vowles Systems Integration Team Queensland Department of Health Australia From: Satyam, Ashutosh [mailto:Ash...@ca...] Sent: Tuesday, 11 August 2015 9:12 AM To: hl7...@li... Subject: [HAPI-devel] Handling Repetitions in fields Hi, I am using HAPI 2.2 library. The goal is to convert HL7 message to XML representation. Here is my challenges with how HAPI is dealing with repetitions. Sample HL7 message - with Field repetition in bold PID:1::952918621~989864122::Cloaked;WAUA;;""::20141211155123:M::1;*WHITE;HL70005;1;*WHITE;99RAC:424 Clark Cir;;Rougon;KY;70773;;P;;034::5555412;PRN;PH;;;;5559782;;;;;8592701727~5551477;ORN;PH;;;;5556958;;;;;""~5551477;ORN;CP;;;;5556958;;;;;""~;NET;X.400;:5555225;WPN;PH;;;;5554747;;;;;"":ENG;ENGLISH;HL70296;ENG;ENGLISH;99CLAN:M:035:539073518;;;A:90000000:::2;NOT HISPANIC/LATINO;HL70189;2;NOT HISPANIC/LATINO;99ETH:::::N:::N:N:::::::::::::::::::N HAPI XML Output (for the repeated fields in bold) <PID.3> <CM_PAT_ID.1>952918621</CM_PAT_ID.1> </PID.3> <PID.3> <CM_PAT_ID.1>989864122</CM_PAT_ID.1> </PID.3> With the above representation it looks like as if it's a component value then the field value itself. Is it possible to get XML output as mentioned below or something on similar lines? I am looking for a generic solution. <PID.3-1>952918621</PID.3-1> <PID.3-2>989864122</PID.3-2> Thanks Ashutosh ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. ********************************************************************************** |
From: Dayu H. <da...@st...> - 2015-08-12 22:39:44
|
Hello I have a sample message below: MSH|^~\&|SOURCE|383018129|PRIORITY HEALTH|382715520|||ORM^O01|0129938170710091448|P|2.3 PID|1|1140004|1140004|1140004|GIBSON^WENDY^ANNE||19540722|F|||BOX 391^226 DAVIES ST^IGNACE^ON^P0T 1T0||(403)934-2893|||M||TB122325/15|1140004 In the code, I use the following methods to receive the home phone number. However, the value is always null, where the value should be (403)934-2893. PID pidSegment = ((ORM_O01)message).getPATIENT().getPID(); String phoneNumber = pidSegment.getPhoneNumberHome(0).getPhoneNumber().getValue(); Please advise as to what I did wrong here. Thanks -- Dayu Han Software Developer Strata Health Solutions Office: +1.403.261.0855 x2102 Website <http://www.stratahealth.com/> | Overview Video <http://youtu.be/5wHGcurxMyY> | Resources <http://www.stratahealth.com/resources/> |
From: Satyam, A. <Ash...@ca...> - 2015-08-10 23:12:19
|
Hi, I am using HAPI 2.2 library. The goal is to convert HL7 message to XML representation. Here is my challenges with how HAPI is dealing with repetitions. Sample HL7 message - with Field repetition in bold PID:1::952918621~989864122::Cloaked;WAUA;;""::20141211155123:M::1;*WHITE;HL70005;1;*WHITE;99RAC:424 Clark Cir;;Rougon;KY;70773;;P;;034::5555412;PRN;PH;;;;5559782;;;;;8592701727~5551477;ORN;PH;;;;5556958;;;;;""~5551477;ORN;CP;;;;5556958;;;;;""~;NET;X.400;:5555225;WPN;PH;;;;5554747;;;;;"":ENG;ENGLISH;HL70296;ENG;ENGLISH;99CLAN:M:035:539073518;;;A:90000000:::2;NOT HISPANIC/LATINO;HL70189;2;NOT HISPANIC/LATINO;99ETH:::::N:::N:N:::::::::::::::::::N HAPI XML Output (for the repeated fields in bold) <PID.3> <CM_PAT_ID.1>952918621</CM_PAT_ID.1> </PID.3> <PID.3> <CM_PAT_ID.1>989864122</CM_PAT_ID.1> </PID.3> With the above representation it looks like as if it's a component value then the field value itself. Is it possible to get XML output as mentioned below or something on similar lines? I am looking for a generic solution. <PID.3-1>952918621</PID.3-1> <PID.3-2>989864122</PID.3-2> Thanks Ashutosh |
From: Gus H. <gu...@ma...> - 2015-08-04 14:52:52
|
Hi all, I’m new to HAPI and HL7 and am having a hard time finding messages to use for testing. Does anyone know where I might find a bunch of HL7 2.5.1 test messages? Thanks! Gus |
From: Giacomo P. <gia...@gm...> - 2015-07-29 13:03:50
|
Hi everybody, I found a memory leak caused by a misuse of the DefaultHapiContext. To keep it short, we were creating many different DefaultHapiContext using the default constructor: HapiContext ctx = new DefaultHapiContext(); This caused a memory leak! The instances of DefaultHapiContext are not collected by the garbage collector since they are referenced by the ApplicationShutdownHook! I found that when calling new DefaultHapiContext(), HAPI creates a default ExecutorService which is then registered to the shutdown hook. This happens when the getExecutorService() is called. I don't know if this needs to get fixed (in the code or in the javadoc), but at least I wanted to share with you this problem. We solved the problem passing a custom ExecutorService to the DefaultHapiContext constructor. |
From: Ian V. <Ian...@he...> - 2015-07-01 23:12:51
|
Our team at Queensland Health in Australia is growing, and our usage of this incredibly helpful API grows with it. As we have delved deeper into the usage of HAPI listener applications we have structured our set of custom messages to try to facilitate a couple of the features we are implementing. Recently we have encountered a circumstance where we would appreciate some clarification. When we build a custom message we try to 'uplift' the definition to version 2.4 regardless of what the vendor message says it uses. In an effort to have a HAPI listener 'automagically' pick up our implementations we use code as shown in the example below. Please excuse the fact that I have pasted the text of the code, our mail gateway does not much like us trying to send out .zip files that contain code. The example has tests that can be made to fail or succeed based upon the dependency libraries you configure. We would like to reach a point where including 'unused' dependencies can be avoided, (the ca.uhn.hl7v2.model.231 set in this example), and wonder if there is a feature we have overlooked that enables this. We would also like to understand when using the packageNames = {"ca.uhn.hl7v2.model.v24", "hapi.test"} seen in the code below, if a definition of a message "ADT_A01" exists in both libraries why it is we have to put our definitions last to get them to be picked up. Code follows: Custom message definition (much cut down just for this example): package hapi.test.message; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.AbstractMessage; import ca.uhn.hl7v2.model.v24.segment.MSH; import ca.uhn.hl7v2.parser.DefaultModelClassFactory; import ca.uhn.hl7v2.parser.ModelClassFactory; public class ADT_A01 extends AbstractMessage { private static final ModelClassFactory DEFAULT_MODEL_CLASS_FACTORY = new DefaultModelClassFactory(); public ADT_A01() throws HL7Exception { this(DEFAULT_MODEL_CLASS_FACTORY); } public ADT_A01(ModelClassFactory modelClassFactory) throws HL7Exception { super(modelClassFactory); this.addSegments(); } private void addSegments() throws HL7Exception { Class<MSH> addMsh = MSH.class; this.add(addMsh, true, false); } public MSH getMSH() throws HL7Exception { return (MSH) get("MSH"); } } Demonstration of success/failure with these tests: package hapi.test; import ca.uhn.hl7v2.DefaultHapiContext; import ca.uhn.hl7v2.HapiContext; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.Varies; import ca.uhn.hl7v2.model.v24.message.ACK; import ca.uhn.hl7v2.parser.CustomModelClassFactory; import ca.uhn.hl7v2.parser.GenericParser; import ca.uhn.hl7v2.validation.builder.support.NoValidationBuilder; import hapi.test.message.ADT_A01; import org.junit.Test; import java.util.HashMap; import java.util.Map; import static org.junit.Assert.assertTrue; public class ADT_A01Test { private static final HapiContext HAPI_CONTEXT = createHapiContext(); private static final String ADT_A01_HL7_EXPLICIT = "MSH|^~\\&|ABCD|123|||20150101000000||ADT^A01^ADT_A01|1234|P|2.3.1\r"; private static final String ADT_A01_HL7_IMPLICIT = "MSH|^~\\&|ABCD|123|||20150101000000||ADT^A01|1234|P|2.3.1\r"; private static CustomModelClassFactory getCustomModelClassFactory() { Map<String, String[]> hl7VersionPackageNamesMap = new HashMap<String, String[]>(); String[] packageNames = {"ca.uhn.hl7v2.model.v24", "hapi.test"}; hl7VersionPackageNamesMap.put("2.3", packageNames); hl7VersionPackageNamesMap.put("2.3.1", packageNames); hl7VersionPackageNamesMap.put("2.4", packageNames); return new CustomModelClassFactory(hl7VersionPackageNamesMap); } private static HapiContext createHapiContext() { System.setProperty(Varies.DEFAULT_OBX2_TYPE_PROP, "ST"); System.setProperty(Varies.INVALID_OBX2_TYPE_PROP, "ST"); HapiContext hapiContext = new DefaultHapiContext(); hapiContext.setModelClassFactory(getCustomModelClassFactory()); hapiContext.setValidationRuleBuilder(new NoValidationBuilder()); hapiContext.getParserConfiguration().setAllowUnknownVersions(true); return hapiContext; } /** * This test passes without hapi-structures-v231 as a project dependency. * * @throws Exception */ @Test public void testHAPICanParseExplicitADT_A01() throws Exception { GenericParser genericParser = new GenericParser(HAPI_CONTEXT); Message adt_a01 = genericParser.parse(ADT_A01_HL7_EXPLICIT); assertTrue("HAPI parsed HL7 to custom ADT_A01 message", adt_a01 instanceof ADT_A01); Message ack = adt_a01.generateACK(); assertTrue("Custom ADT_A01 message generates a v24 ACK", ack instanceof ACK); } /** * This test will only pass with hapi-structures-v231 as a project dependency. * <p/> * ca.uhn.hl7v2.HL7Exception: No map found for version V231. Only the following are available: [V24] * <p/> * Uncomment the hapi-structures-v231 dependency in build.gradle to fix this unit test. * * @throws Exception */ @Test public void testHAPICanParseImplicitADT_A01() throws Exception { GenericParser genericParser = new GenericParser(HAPI_CONTEXT); Message adt_a01 = genericParser.parse(ADT_A01_HL7_IMPLICIT); assertTrue("HAPI parsed HL7 to custom ADT_A01 message", adt_a01 instanceof ADT_A01); Message ack = adt_a01.generateACK(); assertTrue("Custom ADT_A01 message generates a v24 ACK", ack instanceof ACK); } } Build.gradle showing dependencies, with comments on changes to change the results. apply plugin: 'java' sourceCompatibility = 1.5 targetCompatibility = 1.5 repositories { mavenCentral() } dependencies { def hapiVersion = '2.2' compile 'ca.uhn.hapi:hapi-base:' + hapiVersion compile 'ca.uhn.hapi:hapi-structures-v24:' + hapiVersion // Uncommenting the following line fixes the testHAPICanParseImplicitADT_A01 unit test //compile 'ca.uhn.hapi:hapi-structures-v231:' + hapiVersion testCompile 'junit:junit:4.+' } Thanks for your help, and thanks again for the API. We have recently tried out the FHIR 1.0 library at a FHIR connectathon, and found we were not alone in using it, and that it saved us a lot of time getting underway. Ian Vowles Senior Systems Integrator Department of Health Queensland Australia ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. ********************************************************************************** |
From: Zafar I. <zaf...@gm...> - 2015-06-07 05:53:40
|
Dear All, I am glad to be here. I know HL7 basics and Certified HL7 v3. I need to write ORU^R01 message in version 2.3. Could you please help with some sample code for version 2.3. Thanks and appreciate it. Zafar |
From: Christian O. <chr...@gm...> - 2015-04-23 07:36:12
|
Hi, I'm CC-ing the answer to the mailing list, so others might benefit from this discussion as well. You cannot build a "full" HAPI distribution yourself - you would need the HL7 database in order to generate the hl7-structures-* libraries, but the unfortunately this database is far from being open source... Anyway, it's much easier to follow the pattern described in [1] - you provide your custom classes in a dedicated package of your own application and use a CustomModelClassFactory pointing to that package (Example code is available in the hapi-example module). If a message is parsed, the custom model class factory will then first inspect if your custom message needs to be instantiated before falling back to the "standard" message structure classes located in the erspective hapi-structures libs. cheers Christian [1] http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CustomModelClasses.html ---------- Forwarded message ---------- Some time ago (before my time), someone create a customized version of message v2.4 PMU_B01, compiled it and created a jar file hapi-structures-v24-hisca.jar. The jar file was then included as a library into an .ear project. All worked well. Now, I have to make some modifications to the customized message. That is no problem. Where I fail is in how to compile and jar the customized package. I’m alone here, everyone that worked on that project as moved on. Lucky me. So I’ve tried the basics and followed instructions from http://hl7api.sourceforge.net/building.html: - Installed Maven; - Downloaded http://sourceforge.net/p/hl7api/code/HEAD/tree/branches/REL_2_2/hapi-mvn/ - Performed mvn install. But that will only created hapi-base.jar and two other jar files that I don’t need. I was surprised. So I started to dig a bit. Found out that hapi-structures-vXX were basically empty except for some base structures and folder. I was confused. So I went back to the SourceForge website and downloaded hapi-dist-2.2-all.zip. In there, at least, I have .java files where I expect to find some (hapi-structures-v24) but have absolutely not support to build the project (pom.xml). I’m clearly missing something. All I want is to build hapi-base and the hapi-structures-vXX. Can someone point me to the right documentation or tell me how to incorporate the java files from the hapi-dist-2.2-all.zip file into the REL_2_2 so I can finally obtain the expected jar files (hapi-base.jar, hapi-structures-v24.jar). Thank you. E. Ps. By the way, Hapi is an awesome piece of code. Congratulation guys, and keep up the good work. <http://phi...@al...> ------------------------------ This message and any attached documents are only for the use of the intended recipient(s), are confidential and may contain privileged information. Any unauthorized review, use, retransmission, or other disclosure is strictly prohibited. If you have received this message in error, please notify the sender immediately, and then delete the original message. Thank you. |
From: Rick R. <ri...@ne...> - 2015-04-22 22:30:13
|
On a client connection, which should never get closed i.e. try { connection = context.newClient( host, port, useTls ); } catch( HL7Exception ex ) { logger.error( ex ); } return connection; I have the need to detect if the server closes the connection. I can see that ca.uhn.hl7v2.app.Receiver, detects this event and logs it: 18:06:00,060 INFO [ca.uhn.hl7v2.app.Receiver] (hapi-worker-31) SocketException: closing Connection from 172.20.1.129:6661, will no longer read messages with this Receiver: socket closed Is there a way that my application can also detect this event and trigger an alert on it? I see how to do this from the server side: hl7Service.registerApplication( "*", "*", msgHandler ); But do not see how a client connection can detect if the connection is lost. Thanks in advance, Rick Roberts |
From: Ian V. <Ian...@he...> - 2015-04-02 02:18:42
|
Back in 2013 I posted a question regarding unescaped escape characters. The thread can be seen here: http://article.gmane.org/gmane.comp.medical.hl7/1402/match=backslash At the time it was a minor issue that wasn't really bothering us. Unfortunately a recent requirement to receive a message containing a DOS file path has arisen, and the vendor (AGFA) has flatly refused to escape the file path they provide in the message. We had been using a technique whereby we added our own implementation of the package and method in an effort to get our version to be used, but our continuous build environment has not been kind enough to reliably get our implementation on the classpath first. In the thread Christian commented that a pluggable methodology may be applied in Hapi 2.2 did this occur? We are using 2.2 now, but it's not clear that such a facility has been added. Any advice on what we can do would be appreciated. Many thanks Ian ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. ********************************************************************************** |