From: sagarshah1983 <sag...@ci...> - 2013-06-18 15:53:21
|
What is the generic class that can be used for any kind of ADT message covering all the possible segments? I want to handle A01, A04, A05, A08 and A28 messages for now, but might want to extend the same design for any ADT trigger events. Which class from HAPI library is the best fit for the same? I am relatively new to HAPI and hence need a help to get started. I looked at ADT_AXX and ADT_A01 classes, but not sure, if these cover all the required segments as per specific trigger events. -- View this message in context: http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639316.html Sent from the hl7api-devel mailing list archive at Nabble.com. |
From: LDH <ld...@36...> - 2013-06-18 15:58:22
|
I am not aware of one in 1.x... I don't know 2.x well enough yet. I am on the road, but I can send out later the type of code I have used to be adt generic. ___________________________________________ Laurent Hasson (via my BlackBerry) email: ld...@36... cell: 646-283-2186 twitter: @ldhasson -----Original Message----- From: sagarshah1983 <sag...@ci...> Date: Tue, 18 Jun 2013 08:53:15 To: <hl7...@li...> Subject: [HAPI-devel] Generic class for ADT message ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev |
From: sagarshah1983 <sag...@ci...> - 2013-06-18 16:31:46
|
That would be really great for me. Appreciate your reply and time for the same. Regards, Sagar Shah LDH-2 wrote: > > I am not aware of one in 1.x... I don't know 2.x well enough yet. I am on > the road, but I can send out later the type of code I have used to be adt > generic. > > > > ___________________________________________ > Laurent Hasson (via my BlackBerry) > email: ld...@36... > cell: 646-283-2186 > twitter: @ldhasson > > -----Original Message----- > From: sagarshah1983 <sag...@ci...> > Date: Tue, 18 Jun 2013 08:53:15 > To: <hl7...@li...> > Subject: [HAPI-devel] Generic class for ADT message > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html Sent from the hl7api-devel mailing list archive at Nabble.com. |
From: Laurent H. <ld...@36...> - 2013-06-18 20:52:30
|
This is how we do it. I would do it more cleanly if I were to write this again now, but this should point you in the right direction: - We have individual classes to store the data we care about from each segment (see later) - We try to get a segment from the message - If the message is not there, we just throw an exception, ignore and continue protected HL7Record(Message Msg) throws DataTypeException, HL7Exception { try { _PID = new HL7PID((PID)Msg.get("PID")); } catch (HL7Exception E) { } try { Segment segment = (Segment)Msg.get("PV1"); if (segment != null) _PV = new HL7PV((PV1)segment, (PV2)Msg.get("PV2")); } catch (HL7Exception E) { } try { Structure[] Structs = Msg.getAll("DG1"); if (Structs != null && Structs.length > 0) { _DG1 = new HL7DG1[Structs.length]; for (int i = 0; i < Structs.length; ++i) _DG1[i] = new HL7DG1((DG1)Structs[i]); } } catch (HL7Exception E) { } try { Structure[] Structs = Msg.getAll("INSURANCE"); if (Structs != null && Structs.length > 0) _IN1 = new HL7IN1(Structs); } catch (HL7Exception E) { } try { Structure[] Structs = Msg.getAll("AL1"); if (Structs != null && Structs.length > 0) _AL1 = new HL7AL1(Structs); } catch (HL7Exception E) { } try { Segment s = (Segment) Msg.get("MRG"); if (s != null) _MRG = new HL7MRG((MRG)s); } catch (Exception E) { } } And then, for an individual class, for example DG1, we do simple mappings: public class HL7DG1 { public final String _SetId ; public final String _CodingMethod ; public final String _Code ; public final String _Description ; public final HL7DTM _DateTime ; public final String _Type ; public final String _MajorCategory ; public final String _RelatedGroup ; public final HL7XCN _Clinician ; public final String _Classification; public final String _Confidential ; public final String _Identifier ; public HL7DG1(DG1 Diagnosis) throws DataTypeException, HL7Exception { /*DG1-1: Set ID - DG1 (SI) */ _SetId = Diagnosis.getSetIDDG1().getValue(); /*DG1-2: Diagnosis Coding Method (NULLDT) optional */ _CodingMethod = Diagnosis.getDiagnosisCodingMethod().getValue(); /*DG1-3: Diagnosis Code - DG1 (CWE) */ _Code = MakeSureItsAlright(Diagnosis.getDiagnosisCodeDG1().getIdentifier().getValue( ), _CodingMethod); /*DG1-4: Diagnosis Description (NULLDT) optional */ _Description = Diagnosis.getDiagnosisDescription().getValue(); /*DG1-5: Diagnosis Date/Time (DTM) optional */ _DateTime = new HL7DTM(Diagnosis.getDiagnosisDateTime()); /*DG1-6: Diagnosis Type (IS) */ _Type = Diagnosis.getDiagnosisType().getValue(); /*DG1-7: Major Diagnostic Category (CNE) optional */ _MajorCategory = Diagnosis.getMajorDiagnosticCategory().getIdentifier().getValue(); /*DG1-8: Diagnostic Related Group (CNE) optional */ _RelatedGroup = Diagnosis.getDiagnosticRelatedGroup().getIdentifier().getValue(); /*DG1-9: DRG Approval Indicator (ID) optional */ /*DG1-10: DRG Grouper Review Code (IS) optional */ /*DG1-11: Outlier Type (CWE) optional */ /*DG1-12: Outlier Days (NM) optional */ /*DG1-13: Outlier Cost (CP) optional */ /*DG1-14: Grouper Version And Type (NULLDT) optional */ /*DG1-15: Diagnosis Priority (ID) optional */ /*DG1-16: Diagnosing Clinician (XCN) optional repeating */ _Clinician = new HL7XCN(Diagnosis.getDiagnosingClinician(0)); /*DG1-17: Diagnosis Classification (IS) optional */ _Classification = Diagnosis.getDiagnosisClassification().getValue(); /*DG1-18: Confidential Indicator (ID) optional */ _Confidential = Diagnosis.getConfidentialIndicator().getValue(); /*DG1-19: Attestation Date/Time (DTM) optional */ /*DG1-20: Diagnosis Identifier (EI) optional */ _Identifier = Diagnosis.getDiagnosisIdentifier().getEntityIdentifier().getValue(); /*DG1-21: Diagnosis Action Code (ID) optional */ /*DG1-22: Parent Diagnosis (EI) optional */ /*DG1-23: DRG CCL Value Code (CWE) optional */ /*DG1-24: DRG Grouping Usage (ID) optional */ /*DG1-25: DRG Diagnosis Determination Status (IS) optional */ /*DG1-26: Present On Admission (POA) Indicator (IS) optional */ } } What I have found to be the biggest pain is to figure out if the data is in x.getValue(), or x. getIdentifier().getValue() etc. Additionally, again, I would do it a bit differently today and make this a lot more flexible by using the basic parser and access fields with HL7 "paths" J ___________________________________________________________ Laurent Hasson Co-Founder and CTO 360Fresh Inc. Cell: 646.283.2186 Office: 5 Penn Plaza, Suite 1986, NY NY 10001 This e-mail may contain confidential and/or privileged information. This information is intended only for the use of the individual(s) and entity(ies) to whom it is addressed. If you are the intended recipient, further disclosures are prohibited without proper authorization. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden and possibly a violation of federal or state law and regulations. -----Original Message----- From: sagarshah1983 [mailto:sag...@ci...] Sent: Tuesday, June 18, 2013 11:32 To: hl7...@li... Subject: Re: [HAPI-devel] Generic class for ADT message That would be really great for me. Appreciate your reply and time for the same. Regards, Sagar Shah LDH-2 wrote: > > I am not aware of one in 1.x... I don't know 2.x well enough yet. I am > on the road, but I can send out later the type of code I have used to > be adt generic. > > > > ___________________________________________ > Laurent Hasson (via my BlackBerry) > email: <mailto:ld...@36...> ld...@36... > cell: 646-283-2186 > twitter: @ldhasson > > -----Original Message----- > From: sagarshah1983 < <mailto:sag...@ci...> sag...@ci...> > Date: Tue, 18 Jun 2013 08:53:15 > To: < <mailto:hl7...@li...> hl7...@li...> > Subject: [HAPI-devel] Generic class for ADT message > > ---------------------------------------------------------------------- > -------- This SF.net email is sponsored by Windows: > > Build for Windows Store. > > <http://p.sf.net/sfu/windows-dev2dev> http://p.sf.net/sfu/windows-dev2dev > > ---------------------------------------------------------------------- > -------- This SF.net email is sponsored by Windows: > > Build for Windows Store. > > <http://p.sf.net/sfu/windows-dev2dev> http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > <mailto:Hl7...@li...> Hl7...@li... > <https://lists.sourceforge.net/lists/listinfo/hl7api-devel> https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: <http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.htm l> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html Sent from the hl7api-devel mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- This SF.net email is sponsored by Windows: Build for Windows Store. <http://p.sf.net/sfu/windows-dev2dev> http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Hl7api-devel mailing list <mailto:Hl7...@li...> Hl7...@li... <https://lists.sourceforge.net/lists/listinfo/hl7api-devel> https://lists.sourceforge.net/lists/listinfo/hl7api-devel |
From: Ian V. <Ian...@he...> - 2013-06-18 21:34:54
|
I posted this response a couple of weeks back to a similar question about ADT generic. Ian --- I overcame this issue by creating a GENERIC_ADT message using techniques shown on the Hapi site. Our establishment has many Z-segments, so I had to do all those, and group them accordingly. A basic example is available on the Hapi site at http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CustomModelClasses.html Snippets from the objects are shown below. It was quite a long repetitive process, and I even wrote a module that created java code from a text file for the Z segments. However, now it's done all that is required is to create a GENERIC_ADT with it's constructor, and parse the message text with it's parse method. The groups shown in this snippet were defined in similar manner as additional classes in the java project. Hope this helps Ian --- code snippets --- /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package au.gov.qld.health.sit.hl7; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.AbstractMessage; import ca.uhn.hl7v2.model.v24.segment.*; import ca.uhn.hl7v2.parser.ModelClassFactory; /** * * @author VowlesI */ public class GENERIC_ADT extends AbstractMessage { public GENERIC_ADT(ModelClassFactory factory) throws HL7Exception { super(factory); Class<MSH> addMsh = MSH.class; this.add(addMsh,true,false); Class<EVN> addEvn = EVN.class; this.add(addEvn, false, false); Class<SCH> addSch = SCH.class; this.add(addSch, false, false); Class<PID> addPid = PID.class; this.add(addPid, true, false); Class<PD1> addPd1 = PD1.class; this.add(addPd1, false, false); . . snip . . . Class<MASTERFILE> addMasterFile = MASTERFILE.class; this.add(addMasterFile,false,false); Class<ZHBCIS> addZhbcis = ZHBCIS.class; this.add(addZhbcis, false, false); Class<ZNORM> addZnorm = ZNORM.class; this.add(addZnorm, false, false); } public MSH getMSH() throws HL7Exception { return (MSH) get("MSH"); } public EVN getEVN() throws HL7Exception { return (EVN) get ("EVN"); } public SCH getSCH() throws HL7Exception { return (SCH) get ("SCH"); } public PID getPID() throws HL7Exception { return (PID) get ("PID"); } public PD1 getPD1() throws HL7Exception { return (PD1) get ("PD1"); } . . snip . . public MASTERFILE getMASTERFILE() throws HL7Exception { return (MASTERFILE) get ("MASTERFILE"); } public ZHBCIS getZHBCIS() throws HL7Exception { return (ZHBCIS) get ("ZHBCIS"); } public ZNORM getZNORM() throws HL7Exception { return (ZNORM) get ("ZNORM"); } } >>> sagarshah1983 <sag...@ci...> 19/06/13 1:53 >>> What is the generic class that can be used for any kind of ADT message covering all the possible segments? I want to handle A01, A04, A05, A08 and A28 messages for now, but might want to extend the same design for any ADT trigger events. Which class from HAPI library is the best fit for the same? I am relatively new to HAPI and hence need a help to get started. I looked at ADT_AXX and ADT_A01 classes, but not sure, if these cover all the required segments as per specific trigger events. <br><hr align="left" width="300"> View this message in context: <a href="http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639316.html">Generic class for ADT message</a><br> Sent from the <a href="http://old.nabble.com/hl7api-devel-f3468.html">hl7api-devel mailing list archive</a> at Nabble.com.<br> ******************************************************************************** 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: Christian O. <chr...@gm...> - 2013-06-19 06:51:42
|
If you are using HAPI 2.1, you should have a look at this: http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html . cheers Christian 2013/6/18 sagarshah1983 <sag...@ci...> > > That would be really great for me. > Appreciate your reply and time for the same. > > Regards, > Sagar Shah > > LDH-2 wrote: > > > > I am not aware of one in 1.x... I don't know 2.x well enough yet. I am on > > the road, but I can send out later the type of code I have used to be adt > > generic. > > > > > > > > ___________________________________________ > > Laurent Hasson (via my BlackBerry) > > email: ld...@36... > > cell: 646-283-2186 > > twitter: @ldhasson > > > > -----Original Message----- > > From: sagarshah1983 <sag...@ci...> > > Date: Tue, 18 Jun 2013 08:53:15 > > To: <hl7...@li...> > > Subject: [HAPI-devel] Generic class for ADT message > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > http://p.sf.net/sfu/windows-dev2dev > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > > Hl7api-devel mailing list > > Hl7...@li... > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > > > > -- > View this message in context: > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html > Sent from the hl7api-devel mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > |
From: sagarshah1983 <sag...@ci...> - 2013-06-19 07:17:33
|
Thanks Christian for sharing this link. I was trying to use ADT_AXX structure only, but found few issues with generating HL7 message with ADT_AXX and did not find a way to solve that out. So thought of checking for any other generic structure for ADT messages. Anyways, here's the issue I am facing. Code Snippet. ADT_AXX adt = new ADT_AXX(); MSH msh = adt.getMSH(); .... msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); Above works perfectly fine, but the moment I change last two lines to reflect A01, it fails. msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); Error details: Caused by: ca.uhn.hl7v2.validation.ValidationException: Message (superstructure ADT_AXX) of type ADT_A01 must not have content in MSH Any advice is appreciated. Regards, Sagar Shah Christian Ohr-2 wrote: > > If you are using HAPI 2.1, you should have a look at this: > http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html > . > > cheers > Christian > > > 2013/6/18 sagarshah1983 <sag...@ci...> > >> >> That would be really great for me. >> Appreciate your reply and time for the same. >> >> Regards, >> Sagar Shah >> >> LDH-2 wrote: >> > >> > I am not aware of one in 1.x... I don't know 2.x well enough yet. I am >> on >> > the road, but I can send out later the type of code I have used to be >> adt >> > generic. >> > >> > >> > >> > ___________________________________________ >> > Laurent Hasson (via my BlackBerry) >> > email: ld...@36... >> > cell: 646-283-2186 >> > twitter: @ldhasson >> > >> > -----Original Message----- >> > From: sagarshah1983 <sag...@ci...> >> > Date: Tue, 18 Jun 2013 08:53:15 >> > To: <hl7...@li...> >> > Subject: [HAPI-devel] Generic class for ADT message >> > >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Windows: >> > >> > Build for Windows Store. >> > >> > http://p.sf.net/sfu/windows-dev2dev >> > >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Windows: >> > >> > Build for Windows Store. >> > >> > http://p.sf.net/sfu/windows-dev2dev >> > _______________________________________________ >> > Hl7api-devel mailing list >> > Hl7...@li... >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> Hl7api-devel mailing list >> Hl7...@li... >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html Sent from the hl7api-devel mailing list archive at Nabble.com. |
From: Christian O. <chr...@gm...> - 2013-06-19 08:50:24
|
Yes, I can reproduce this problem. It seems that the MSH segment is not allowed e.g. for A01 message by the validator, which is obviously nonsense. Maybe James can enlighten this a bit.... potentially there's a bug in the generator. After all, when creating messages I don't see a need to create superstructure messages, as you know which message you create. You still have the problem that there is no common super-class or interface to ADT messages, but their are ways to circumvent this, e.g. using the Terser class: Message m = new ADT_A01(); m.initQuickstart("ADT", "A01", "P"); // everything below works on a generic level Terser t = new Terser(m); t.set("/MSH-9-2", "A04"); t.set("/PID-3-1", "myIdentifier"); ... hope this helps Christian 2013/6/19 sagarshah1983 <sag...@ci...> > > Thanks Christian for sharing this link. > I was trying to use ADT_AXX structure only, but found few issues with > generating HL7 message with ADT_AXX and did not find a way to solve that > out. So thought of checking for any other generic structure for ADT > messages. > Anyways, here's the issue I am facing. > Code Snippet. > > ADT_AXX adt = new ADT_AXX(); > MSH msh = adt.getMSH(); > .... > msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); > msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); > msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); > > Above works perfectly fine, but the moment I change last two lines to > reflect A01, it fails. > > msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); > msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); > > Error details: > Caused by: ca.uhn.hl7v2.validation.ValidationException: Message > (superstructure ADT_AXX) of type ADT_A01 must not have content in MSH > > Any advice is appreciated. > > Regards, > Sagar Shah > > > > Christian Ohr-2 wrote: > > > > If you are using HAPI 2.1, you should have a look at this: > > > http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html > > . > > > > cheers > > Christian > > > > > > 2013/6/18 sagarshah1983 <sag...@ci...> > > > >> > >> That would be really great for me. > >> Appreciate your reply and time for the same. > >> > >> Regards, > >> Sagar Shah > >> > >> LDH-2 wrote: > >> > > >> > I am not aware of one in 1.x... I don't know 2.x well enough yet. I am > >> on > >> > the road, but I can send out later the type of code I have used to be > >> adt > >> > generic. > >> > > >> > > >> > > >> > ___________________________________________ > >> > Laurent Hasson (via my BlackBerry) > >> > email: ld...@36... > >> > cell: 646-283-2186 > >> > twitter: @ldhasson > >> > > >> > -----Original Message----- > >> > From: sagarshah1983 <sag...@ci...> > >> > Date: Tue, 18 Jun 2013 08:53:15 > >> > To: <hl7...@li...> > >> > Subject: [HAPI-devel] Generic class for ADT message > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > This SF.net email is sponsored by Windows: > >> > > >> > Build for Windows Store. > >> > > >> > http://p.sf.net/sfu/windows-dev2dev > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > This SF.net email is sponsored by Windows: > >> > > >> > Build for Windows Store. > >> > > >> > http://p.sf.net/sfu/windows-dev2dev > >> > _______________________________________________ > >> > Hl7api-devel mailing list > >> > Hl7...@li... > >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> > > >> > > >> > >> -- > >> View this message in context: > >> > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html > >> Sent from the hl7api-devel mailing list archive at Nabble.com. > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Windows: > >> > >> Build for Windows Store. > >> > >> http://p.sf.net/sfu/windows-dev2dev > >> _______________________________________________ > >> Hl7api-devel mailing list > >> Hl7...@li... > >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > > Hl7api-devel mailing list > > Hl7...@li... > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > > > -- > View this message in context: > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html > Sent from the hl7api-devel mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > |
From: sagarshah1983 <sag...@ci...> - 2013-06-19 09:35:32
|
Thanks a ton Christian for this. I think I can make use of Terser to make it generic and use ADT_A01 as base message, as there are some issues with ADT_AXX as reported in previous message. Christian Ohr-2 wrote: > > Yes, I can reproduce this problem. It seems that the MSH segment is not > allowed e.g. for A01 message by the validator, which is obviously > nonsense. > Maybe James can enlighten this a bit.... potentially there's a bug in the > generator. > > After all, when creating messages I don't see a need to create > superstructure messages, as you know which message you create. You still > have the problem that there is no common super-class or interface to ADT > messages, but their are ways to circumvent this, e.g. using the Terser > class: > > Message m = new ADT_A01(); > m.initQuickstart("ADT", "A01", "P"); > // everything below works on a generic level > Terser t = new Terser(m); > t.set("/MSH-9-2", "A04"); > t.set("/PID-3-1", "myIdentifier"); > ... > > hope this helps > Christian > > > 2013/6/19 sagarshah1983 <sag...@ci...> > >> >> Thanks Christian for sharing this link. >> I was trying to use ADT_AXX structure only, but found few issues with >> generating HL7 message with ADT_AXX and did not find a way to solve that >> out. So thought of checking for any other generic structure for ADT >> messages. >> Anyways, here's the issue I am facing. >> Code Snippet. >> >> ADT_AXX adt = new ADT_AXX(); >> MSH msh = adt.getMSH(); >> .... >> msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); >> >> Above works perfectly fine, but the moment I change last two lines to >> reflect A01, it fails. >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); >> >> Error details: >> Caused by: ca.uhn.hl7v2.validation.ValidationException: Message >> (superstructure ADT_AXX) of type ADT_A01 must not have content in MSH >> >> Any advice is appreciated. >> >> Regards, >> Sagar Shah >> >> >> >> Christian Ohr-2 wrote: >> > >> > If you are using HAPI 2.1, you should have a look at this: >> > >> http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html >> > . >> > >> > cheers >> > Christian >> > >> > >> > 2013/6/18 sagarshah1983 <sag...@ci...> >> > >> >> >> >> That would be really great for me. >> >> Appreciate your reply and time for the same. >> >> >> >> Regards, >> >> Sagar Shah >> >> >> >> LDH-2 wrote: >> >> > >> >> > I am not aware of one in 1.x... I don't know 2.x well enough yet. I >> am >> >> on >> >> > the road, but I can send out later the type of code I have used to >> be >> >> adt >> >> > generic. >> >> > >> >> > >> >> > >> >> > ___________________________________________ >> >> > Laurent Hasson (via my BlackBerry) >> >> > email: ld...@36... >> >> > cell: 646-283-2186 >> >> > twitter: @ldhasson >> >> > >> >> > -----Original Message----- >> >> > From: sagarshah1983 <sag...@ci...> >> >> > Date: Tue, 18 Jun 2013 08:53:15 >> >> > To: <hl7...@li...> >> >> > Subject: [HAPI-devel] Generic class for ADT message >> >> > >> >> > >> >> >> ------------------------------------------------------------------------------ >> >> > This SF.net email is sponsored by Windows: >> >> > >> >> > Build for Windows Store. >> >> > >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> > >> >> > >> >> >> ------------------------------------------------------------------------------ >> >> > This SF.net email is sponsored by Windows: >> >> > >> >> > Build for Windows Store. >> >> > >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> > _______________________________________________ >> >> > Hl7api-devel mailing list >> >> > Hl7...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> This SF.net email is sponsored by Windows: >> >> >> >> Build for Windows Store. >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> _______________________________________________ >> >> Hl7api-devel mailing list >> >> Hl7...@li... >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Windows: >> > >> > Build for Windows Store. >> > >> > http://p.sf.net/sfu/windows-dev2dev >> > _______________________________________________ >> > Hl7api-devel mailing list >> > Hl7...@li... >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > >> > >> -- >> View this message in context: >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> Hl7api-devel mailing list >> Hl7...@li... >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642561.html Sent from the hl7api-devel mailing list archive at Nabble.com. |
From: James A. <ja...@ja...> - 2013-06-19 13:00:19
|
Hi All, This does indeed appear to be a bug in the generator for the superstructures unfortunately. Sagar, the good news is that your code *should* work, you're doing the right thing. But the bad news is that it isn't working obviously. :) Superstructures are a brand new feature, and they haven't yet been heavily used. I've got a fix for this issue locally, but it isn't yet released. One workaround you could easily implement would be to create your own local replacement class for ADT_AXX by copying the source to that class somewhere else and fixing the issue. The source for this class is here (NB this is the HL7 v2.4 version): http://grepcode.com/file_/repo1.maven.org/maven2/ca.uhn.hapi/hapi-structures-v24/2.1-beta1/ca/uhn/hl7v2/model/v24/message/ADT_AXX.java/?v=source If you look at the "init" method, you see a long string of method calls like this: this.addSuperstructureApplication("MSH", "ADT_A04"); These are the calls which advise HAPI that MSH may be used for an ADT_A04 message, but the bug is that there isn't a corresponding line for ADT_A01. If you add that, you'll be allowed to add an MSH segment to an A01 message. You'll need to do this for every segment and message type combination though, which I realise will be annoying. I'm going to try and get a fix at least checked in within the next week or two... Cheers, James On Wed, Jun 19, 2013 at 5:35 AM, sagarshah1983 <sag...@ci...>wrote: > > Thanks a ton Christian for this. > I think I can make use of Terser to make it generic and use ADT_A01 as base > message, as there are some issues with ADT_AXX as reported in previous > message. > > > > Christian Ohr-2 wrote: > > > > Yes, I can reproduce this problem. It seems that the MSH segment is not > > allowed e.g. for A01 message by the validator, which is obviously > > nonsense. > > Maybe James can enlighten this a bit.... potentially there's a bug in the > > generator. > > > > After all, when creating messages I don't see a need to create > > superstructure messages, as you know which message you create. You still > > have the problem that there is no common super-class or interface to ADT > > messages, but their are ways to circumvent this, e.g. using the Terser > > class: > > > > Message m = new ADT_A01(); > > m.initQuickstart("ADT", "A01", "P"); > > // everything below works on a generic level > > Terser t = new Terser(m); > > t.set("/MSH-9-2", "A04"); > > t.set("/PID-3-1", "myIdentifier"); > > ... > > > > hope this helps > > Christian > > > > > > 2013/6/19 sagarshah1983 <sag...@ci...> > > > >> > >> Thanks Christian for sharing this link. > >> I was trying to use ADT_AXX structure only, but found few issues with > >> generating HL7 message with ADT_AXX and did not find a way to solve that > >> out. So thought of checking for any other generic structure for ADT > >> messages. > >> Anyways, here's the issue I am facing. > >> Code Snippet. > >> > >> ADT_AXX adt = new ADT_AXX(); > >> MSH msh = adt.getMSH(); > >> .... > >> msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); > >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); > >> > msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); > >> > >> Above works perfectly fine, but the moment I change last two lines to > >> reflect A01, it fails. > >> > >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); > >> > msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); > >> > >> Error details: > >> Caused by: ca.uhn.hl7v2.validation.ValidationException: Message > >> (superstructure ADT_AXX) of type ADT_A01 must not have content in MSH > >> > >> Any advice is appreciated. > >> > >> Regards, > >> Sagar Shah > >> > >> > >> > >> Christian Ohr-2 wrote: > >> > > >> > If you are using HAPI 2.1, you should have a look at this: > >> > > >> > http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html > >> > . > >> > > >> > cheers > >> > Christian > >> > > >> > > >> > 2013/6/18 sagarshah1983 <sag...@ci...> > >> > > >> >> > >> >> That would be really great for me. > >> >> Appreciate your reply and time for the same. > >> >> > >> >> Regards, > >> >> Sagar Shah > >> >> > >> >> LDH-2 wrote: > >> >> > > >> >> > I am not aware of one in 1.x... I don't know 2.x well enough yet. I > >> am > >> >> on > >> >> > the road, but I can send out later the type of code I have used to > >> be > >> >> adt > >> >> > generic. > >> >> > > >> >> > > >> >> > > >> >> > ___________________________________________ > >> >> > Laurent Hasson (via my BlackBerry) > >> >> > email: ld...@36... > >> >> > cell: 646-283-2186 > >> >> > twitter: @ldhasson > >> >> > > >> >> > -----Original Message----- > >> >> > From: sagarshah1983 <sag...@ci...> > >> >> > Date: Tue, 18 Jun 2013 08:53:15 > >> >> > To: <hl7...@li...> > >> >> > Subject: [HAPI-devel] Generic class for ADT message > >> >> > > >> >> > > >> >> > >> > ------------------------------------------------------------------------------ > >> >> > This SF.net email is sponsored by Windows: > >> >> > > >> >> > Build for Windows Store. > >> >> > > >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> > > >> >> > > >> >> > >> > ------------------------------------------------------------------------------ > >> >> > This SF.net email is sponsored by Windows: > >> >> > > >> >> > Build for Windows Store. > >> >> > > >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> > _______________________________________________ > >> >> > Hl7api-devel mailing list > >> >> > Hl7...@li... > >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> >> > > >> >> > > >> >> > >> >> -- > >> >> View this message in context: > >> >> > >> > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html > >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. > >> >> > >> >> > >> >> > >> >> > >> > ------------------------------------------------------------------------------ > >> >> This SF.net email is sponsored by Windows: > >> >> > >> >> Build for Windows Store. > >> >> > >> >> http://p.sf.net/sfu/windows-dev2dev > >> >> _______________________________________________ > >> >> Hl7api-devel mailing list > >> >> Hl7...@li... > >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> >> > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > This SF.net email is sponsored by Windows: > >> > > >> > Build for Windows Store. > >> > > >> > http://p.sf.net/sfu/windows-dev2dev > >> > _______________________________________________ > >> > Hl7api-devel mailing list > >> > Hl7...@li... > >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> > > >> > > >> -- > >> View this message in context: > >> > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html > >> Sent from the hl7api-devel mailing list archive at Nabble.com. > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Windows: > >> > >> Build for Windows Store. > >> > >> http://p.sf.net/sfu/windows-dev2dev > >> _______________________________________________ > >> Hl7api-devel mailing list > >> Hl7...@li... > >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > > Hl7api-devel mailing list > > Hl7...@li... > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > > > > -- > View this message in context: > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642561.html > Sent from the hl7api-devel mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > |
From: sagarshah1983 <sag...@ci...> - 2013-06-19 13:39:22
|
Thanks a ton James for clarifications. I will look at ADT_AXX and create another structure out of the same at my end and follow your instructions as a work around. Appreciate your suggestions. Regards, Sagar Shah James Agnew wrote: > > Hi All, > > This does indeed appear to be a bug in the generator for the > superstructures unfortunately. Sagar, the good news is that your code > *should* work, you're doing the right thing. But the bad news is that it > isn't working obviously. :) > > Superstructures are a brand new feature, and they haven't yet been heavily > used. I've got a fix for this issue locally, but it isn't yet released. > > One workaround you could easily implement would be to create your own > local > replacement class for ADT_AXX by copying the source to that class > somewhere > else and fixing the issue. The source for this class is here (NB this is > the HL7 v2.4 version): > http://grepcode.com/file_/repo1.maven.org/maven2/ca.uhn.hapi/hapi-structures-v24/2.1-beta1/ca/uhn/hl7v2/model/v24/message/ADT_AXX.java/?v=source > > If you look at the "init" method, you see a long string of method calls > like this: > > this.addSuperstructureApplication("MSH", "ADT_A04"); > > These are the calls which advise HAPI that MSH may be used for an ADT_A04 > message, but the bug is that there isn't a corresponding line for ADT_A01. > If you add that, you'll be allowed to add an MSH segment to an A01 > message. > You'll need to do this for every segment and message type combination > though, which I realise will be annoying. > > I'm going to try and get a fix at least checked in within the next week or > two... > > Cheers, > James > > > On Wed, Jun 19, 2013 at 5:35 AM, sagarshah1983 > <sag...@ci...>wrote: > >> >> Thanks a ton Christian for this. >> I think I can make use of Terser to make it generic and use ADT_A01 as >> base >> message, as there are some issues with ADT_AXX as reported in previous >> message. >> >> >> >> Christian Ohr-2 wrote: >> > >> > Yes, I can reproduce this problem. It seems that the MSH segment is not >> > allowed e.g. for A01 message by the validator, which is obviously >> > nonsense. >> > Maybe James can enlighten this a bit.... potentially there's a bug in >> the >> > generator. >> > >> > After all, when creating messages I don't see a need to create >> > superstructure messages, as you know which message you create. You >> still >> > have the problem that there is no common super-class or interface to >> ADT >> > messages, but their are ways to circumvent this, e.g. using the Terser >> > class: >> > >> > Message m = new ADT_A01(); >> > m.initQuickstart("ADT", "A01", "P"); >> > // everything below works on a generic level >> > Terser t = new Terser(m); >> > t.set("/MSH-9-2", "A04"); >> > t.set("/PID-3-1", "myIdentifier"); >> > ... >> > >> > hope this helps >> > Christian >> > >> > >> > 2013/6/19 sagarshah1983 <sag...@ci...> >> > >> >> >> >> Thanks Christian for sharing this link. >> >> I was trying to use ADT_AXX structure only, but found few issues with >> >> generating HL7 message with ADT_AXX and did not find a way to solve >> that >> >> out. So thought of checking for any other generic structure for ADT >> >> messages. >> >> Anyways, here's the issue I am facing. >> >> Code Snippet. >> >> >> >> ADT_AXX adt = new ADT_AXX(); >> >> MSH msh = adt.getMSH(); >> >> .... >> >> msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); >> >> >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); >> >> >> >> Above works perfectly fine, but the moment I change last two lines to >> >> reflect A01, it fails. >> >> >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); >> >> >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); >> >> >> >> Error details: >> >> Caused by: ca.uhn.hl7v2.validation.ValidationException: Message >> >> (superstructure ADT_AXX) of type ADT_A01 must not have content in MSH >> >> >> >> Any advice is appreciated. >> >> >> >> Regards, >> >> Sagar Shah >> >> >> >> >> >> >> >> Christian Ohr-2 wrote: >> >> > >> >> > If you are using HAPI 2.1, you should have a look at this: >> >> > >> >> >> http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html >> >> > . >> >> > >> >> > cheers >> >> > Christian >> >> > >> >> > >> >> > 2013/6/18 sagarshah1983 <sag...@ci...> >> >> > >> >> >> >> >> >> That would be really great for me. >> >> >> Appreciate your reply and time for the same. >> >> >> >> >> >> Regards, >> >> >> Sagar Shah >> >> >> >> >> >> LDH-2 wrote: >> >> >> > >> >> >> > I am not aware of one in 1.x... I don't know 2.x well enough yet. >> I >> >> am >> >> >> on >> >> >> > the road, but I can send out later the type of code I have used >> to >> >> be >> >> >> adt >> >> >> > generic. >> >> >> > >> >> >> > >> >> >> > >> >> >> > ___________________________________________ >> >> >> > Laurent Hasson (via my BlackBerry) >> >> >> > email: ld...@36... >> >> >> > cell: 646-283-2186 >> >> >> > twitter: @ldhasson >> >> >> > >> >> >> > -----Original Message----- >> >> >> > From: sagarshah1983 <sag...@ci...> >> >> >> > Date: Tue, 18 Jun 2013 08:53:15 >> >> >> > To: <hl7...@li...> >> >> >> > Subject: [HAPI-devel] Generic class for ADT message >> >> >> > >> >> >> > >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> > This SF.net email is sponsored by Windows: >> >> >> > >> >> >> > Build for Windows Store. >> >> >> > >> >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> >> > >> >> >> > >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> > This SF.net email is sponsored by Windows: >> >> >> > >> >> >> > Build for Windows Store. >> >> >> > >> >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> >> > _______________________________________________ >> >> >> > Hl7api-devel mailing list >> >> >> > Hl7...@li... >> >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > >> >> >> > >> >> >> >> >> >> -- >> >> >> View this message in context: >> >> >> >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html >> >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> This SF.net email is sponsored by Windows: >> >> >> >> >> >> Build for Windows Store. >> >> >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> >> _______________________________________________ >> >> >> Hl7api-devel mailing list >> >> >> Hl7...@li... >> >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> >> >> > >> >> > >> >> >> ------------------------------------------------------------------------------ >> >> > This SF.net email is sponsored by Windows: >> >> > >> >> > Build for Windows Store. >> >> > >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> > _______________________________________________ >> >> > Hl7api-devel mailing list >> >> > Hl7...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> > >> >> > >> >> -- >> >> View this message in context: >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> This SF.net email is sponsored by Windows: >> >> >> >> Build for Windows Store. >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> _______________________________________________ >> >> Hl7api-devel mailing list >> >> Hl7...@li... >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Windows: >> > >> > Build for Windows Store. >> > >> > http://p.sf.net/sfu/windows-dev2dev >> > _______________________________________________ >> > Hl7api-devel mailing list >> > Hl7...@li... >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642561.html >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> Hl7api-devel mailing list >> Hl7...@li... >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35643545.html Sent from the hl7api-devel mailing list archive at Nabble.com. |
From: sagarshah1983 <sag...@ci...> - 2013-06-19 13:59:47
|
Hi James, I also had one more question to understand difference between ADT_AXX and ADT_A01. The issues that I am getting is with ADT_AXX. So what if I have to replace this with ADT_A01. Can I used ADT_A01 class to generate ADT A04, A05, A08 and A28 messages as well? I tried generating just MSH and PID segment using ADT_A01 for above listed different triggers and that atleast worked well. Regards, Sagar Shah James Agnew wrote: > > Hi All, > > This does indeed appear to be a bug in the generator for the > superstructures unfortunately. Sagar, the good news is that your code > *should* work, you're doing the right thing. But the bad news is that it > isn't working obviously. :) > > Superstructures are a brand new feature, and they haven't yet been heavily > used. I've got a fix for this issue locally, but it isn't yet released. > > One workaround you could easily implement would be to create your own > local > replacement class for ADT_AXX by copying the source to that class > somewhere > else and fixing the issue. The source for this class is here (NB this is > the HL7 v2.4 version): > http://grepcode.com/file_/repo1.maven.org/maven2/ca.uhn.hapi/hapi-structures-v24/2.1-beta1/ca/uhn/hl7v2/model/v24/message/ADT_AXX.java/?v=source > > If you look at the "init" method, you see a long string of method calls > like this: > > this.addSuperstructureApplication("MSH", "ADT_A04"); > > These are the calls which advise HAPI that MSH may be used for an ADT_A04 > message, but the bug is that there isn't a corresponding line for ADT_A01. > If you add that, you'll be allowed to add an MSH segment to an A01 > message. > You'll need to do this for every segment and message type combination > though, which I realise will be annoying. > > I'm going to try and get a fix at least checked in within the next week or > two... > > Cheers, > James > > > On Wed, Jun 19, 2013 at 5:35 AM, sagarshah1983 > <sag...@ci...>wrote: > >> >> Thanks a ton Christian for this. >> I think I can make use of Terser to make it generic and use ADT_A01 as >> base >> message, as there are some issues with ADT_AXX as reported in previous >> message. >> >> >> >> Christian Ohr-2 wrote: >> > >> > Yes, I can reproduce this problem. It seems that the MSH segment is not >> > allowed e.g. for A01 message by the validator, which is obviously >> > nonsense. >> > Maybe James can enlighten this a bit.... potentially there's a bug in >> the >> > generator. >> > >> > After all, when creating messages I don't see a need to create >> > superstructure messages, as you know which message you create. You >> still >> > have the problem that there is no common super-class or interface to >> ADT >> > messages, but their are ways to circumvent this, e.g. using the Terser >> > class: >> > >> > Message m = new ADT_A01(); >> > m.initQuickstart("ADT", "A01", "P"); >> > // everything below works on a generic level >> > Terser t = new Terser(m); >> > t.set("/MSH-9-2", "A04"); >> > t.set("/PID-3-1", "myIdentifier"); >> > ... >> > >> > hope this helps >> > Christian >> > >> > >> > 2013/6/19 sagarshah1983 <sag...@ci...> >> > >> >> >> >> Thanks Christian for sharing this link. >> >> I was trying to use ADT_AXX structure only, but found few issues with >> >> generating HL7 message with ADT_AXX and did not find a way to solve >> that >> >> out. So thought of checking for any other generic structure for ADT >> >> messages. >> >> Anyways, here's the issue I am facing. >> >> Code Snippet. >> >> >> >> ADT_AXX adt = new ADT_AXX(); >> >> MSH msh = adt.getMSH(); >> >> .... >> >> msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); >> >> >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); >> >> >> >> Above works perfectly fine, but the moment I change last two lines to >> >> reflect A01, it fails. >> >> >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); >> >> >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); >> >> >> >> Error details: >> >> Caused by: ca.uhn.hl7v2.validation.ValidationException: Message >> >> (superstructure ADT_AXX) of type ADT_A01 must not have content in MSH >> >> >> >> Any advice is appreciated. >> >> >> >> Regards, >> >> Sagar Shah >> >> >> >> >> >> >> >> Christian Ohr-2 wrote: >> >> > >> >> > If you are using HAPI 2.1, you should have a look at this: >> >> > >> >> >> http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html >> >> > . >> >> > >> >> > cheers >> >> > Christian >> >> > >> >> > >> >> > 2013/6/18 sagarshah1983 <sag...@ci...> >> >> > >> >> >> >> >> >> That would be really great for me. >> >> >> Appreciate your reply and time for the same. >> >> >> >> >> >> Regards, >> >> >> Sagar Shah >> >> >> >> >> >> LDH-2 wrote: >> >> >> > >> >> >> > I am not aware of one in 1.x... I don't know 2.x well enough yet. >> I >> >> am >> >> >> on >> >> >> > the road, but I can send out later the type of code I have used >> to >> >> be >> >> >> adt >> >> >> > generic. >> >> >> > >> >> >> > >> >> >> > >> >> >> > ___________________________________________ >> >> >> > Laurent Hasson (via my BlackBerry) >> >> >> > email: ld...@36... >> >> >> > cell: 646-283-2186 >> >> >> > twitter: @ldhasson >> >> >> > >> >> >> > -----Original Message----- >> >> >> > From: sagarshah1983 <sag...@ci...> >> >> >> > Date: Tue, 18 Jun 2013 08:53:15 >> >> >> > To: <hl7...@li...> >> >> >> > Subject: [HAPI-devel] Generic class for ADT message >> >> >> > >> >> >> > >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> > This SF.net email is sponsored by Windows: >> >> >> > >> >> >> > Build for Windows Store. >> >> >> > >> >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> >> > >> >> >> > >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> > This SF.net email is sponsored by Windows: >> >> >> > >> >> >> > Build for Windows Store. >> >> >> > >> >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> >> > _______________________________________________ >> >> >> > Hl7api-devel mailing list >> >> >> > Hl7...@li... >> >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > >> >> >> > >> >> >> >> >> >> -- >> >> >> View this message in context: >> >> >> >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html >> >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> This SF.net email is sponsored by Windows: >> >> >> >> >> >> Build for Windows Store. >> >> >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> >> _______________________________________________ >> >> >> Hl7api-devel mailing list >> >> >> Hl7...@li... >> >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> >> >> > >> >> > >> >> >> ------------------------------------------------------------------------------ >> >> > This SF.net email is sponsored by Windows: >> >> > >> >> > Build for Windows Store. >> >> > >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> > _______________________________________________ >> >> > Hl7api-devel mailing list >> >> > Hl7...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> > >> >> > >> >> -- >> >> View this message in context: >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> This SF.net email is sponsored by Windows: >> >> >> >> Build for Windows Store. >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> _______________________________________________ >> >> Hl7api-devel mailing list >> >> Hl7...@li... >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Windows: >> > >> > Build for Windows Store. >> > >> > http://p.sf.net/sfu/windows-dev2dev >> > _______________________________________________ >> > Hl7api-devel mailing list >> > Hl7...@li... >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642561.html >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> Hl7api-devel mailing list >> Hl7...@li... >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35643630.html Sent from the hl7api-devel mailing list archive at Nabble.com. |
From: James A. <ja...@ja...> - 2013-06-19 14:07:11
|
Hi Sagar, Yes, there is definitely nothing wrong with using ADT_A01 to generate other types of messages. The only challenge you may run into is that some ADT message types will have structures that ADT_A01 doesn't have. For example, an ADT_A17 has a second set of PID and PV1 segments, and these segments (which HAPI refers to as PID2 and PV12) don't exist in the ADT_A01 structure. The workaround there is to use the addNonStandardSegment method to add them as needed. This is definitely fine, and is fairly common. Cheers, James On Wed, Jun 19, 2013 at 9:59 AM, sagarshah1983 <sag...@ci...>wrote: > > Hi James, > I also had one more question to understand difference between ADT_AXX and > ADT_A01. > > The issues that I am getting is with ADT_AXX. So what if I have to replace > this with ADT_A01. > Can I used ADT_A01 class to generate ADT A04, A05, A08 and A28 messages as > well? > I tried generating just MSH and PID segment using ADT_A01 for above listed > different triggers and that atleast worked well. > > > Regards, > Sagar Shah > > James Agnew wrote: > > > > Hi All, > > > > This does indeed appear to be a bug in the generator for the > > superstructures unfortunately. Sagar, the good news is that your code > > *should* work, you're doing the right thing. But the bad news is that it > > isn't working obviously. :) > > > > Superstructures are a brand new feature, and they haven't yet been > heavily > > used. I've got a fix for this issue locally, but it isn't yet released. > > > > One workaround you could easily implement would be to create your own > > local > > replacement class for ADT_AXX by copying the source to that class > > somewhere > > else and fixing the issue. The source for this class is here (NB this is > > the HL7 v2.4 version): > > > http://grepcode.com/file_/repo1.maven.org/maven2/ca.uhn.hapi/hapi-structures-v24/2.1-beta1/ca/uhn/hl7v2/model/v24/message/ADT_AXX.java/?v=source > > > > If you look at the "init" method, you see a long string of method calls > > like this: > > > > this.addSuperstructureApplication("MSH", "ADT_A04"); > > > > These are the calls which advise HAPI that MSH may be used for an ADT_A04 > > message, but the bug is that there isn't a corresponding line for > ADT_A01. > > If you add that, you'll be allowed to add an MSH segment to an A01 > > message. > > You'll need to do this for every segment and message type combination > > though, which I realise will be annoying. > > > > I'm going to try and get a fix at least checked in within the next week > or > > two... > > > > Cheers, > > James > > > > > > On Wed, Jun 19, 2013 at 5:35 AM, sagarshah1983 > > <sag...@ci...>wrote: > > > >> > >> Thanks a ton Christian for this. > >> I think I can make use of Terser to make it generic and use ADT_A01 as > >> base > >> message, as there are some issues with ADT_AXX as reported in previous > >> message. > >> > >> > >> > >> Christian Ohr-2 wrote: > >> > > >> > Yes, I can reproduce this problem. It seems that the MSH segment is > not > >> > allowed e.g. for A01 message by the validator, which is obviously > >> > nonsense. > >> > Maybe James can enlighten this a bit.... potentially there's a bug in > >> the > >> > generator. > >> > > >> > After all, when creating messages I don't see a need to create > >> > superstructure messages, as you know which message you create. You > >> still > >> > have the problem that there is no common super-class or interface to > >> ADT > >> > messages, but their are ways to circumvent this, e.g. using the Terser > >> > class: > >> > > >> > Message m = new ADT_A01(); > >> > m.initQuickstart("ADT", "A01", "P"); > >> > // everything below works on a generic level > >> > Terser t = new Terser(m); > >> > t.set("/MSH-9-2", "A04"); > >> > t.set("/PID-3-1", "myIdentifier"); > >> > ... > >> > > >> > hope this helps > >> > Christian > >> > > >> > > >> > 2013/6/19 sagarshah1983 <sag...@ci...> > >> > > >> >> > >> >> Thanks Christian for sharing this link. > >> >> I was trying to use ADT_AXX structure only, but found few issues with > >> >> generating HL7 message with ADT_AXX and did not find a way to solve > >> that > >> >> out. So thought of checking for any other generic structure for ADT > >> >> messages. > >> >> Anyways, here's the issue I am facing. > >> >> Code Snippet. > >> >> > >> >> ADT_AXX adt = new ADT_AXX(); > >> >> MSH msh = adt.getMSH(); > >> >> .... > >> >> msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); > >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); > >> >> > >> > msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); > >> >> > >> >> Above works perfectly fine, but the moment I change last two lines to > >> >> reflect A01, it fails. > >> >> > >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); > >> >> > >> > msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); > >> >> > >> >> Error details: > >> >> Caused by: ca.uhn.hl7v2.validation.ValidationException: Message > >> >> (superstructure ADT_AXX) of type ADT_A01 must not have content in MSH > >> >> > >> >> Any advice is appreciated. > >> >> > >> >> Regards, > >> >> Sagar Shah > >> >> > >> >> > >> >> > >> >> Christian Ohr-2 wrote: > >> >> > > >> >> > If you are using HAPI 2.1, you should have a look at this: > >> >> > > >> >> > >> > http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html > >> >> > . > >> >> > > >> >> > cheers > >> >> > Christian > >> >> > > >> >> > > >> >> > 2013/6/18 sagarshah1983 <sag...@ci...> > >> >> > > >> >> >> > >> >> >> That would be really great for me. > >> >> >> Appreciate your reply and time for the same. > >> >> >> > >> >> >> Regards, > >> >> >> Sagar Shah > >> >> >> > >> >> >> LDH-2 wrote: > >> >> >> > > >> >> >> > I am not aware of one in 1.x... I don't know 2.x well enough > yet. > >> I > >> >> am > >> >> >> on > >> >> >> > the road, but I can send out later the type of code I have used > >> to > >> >> be > >> >> >> adt > >> >> >> > generic. > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > ___________________________________________ > >> >> >> > Laurent Hasson (via my BlackBerry) > >> >> >> > email: ld...@36... > >> >> >> > cell: 646-283-2186 > >> >> >> > twitter: @ldhasson > >> >> >> > > >> >> >> > -----Original Message----- > >> >> >> > From: sagarshah1983 <sag...@ci...> > >> >> >> > Date: Tue, 18 Jun 2013 08:53:15 > >> >> >> > To: <hl7...@li...> > >> >> >> > Subject: [HAPI-devel] Generic class for ADT message > >> >> >> > > >> >> >> > > >> >> >> > >> >> > >> > ------------------------------------------------------------------------------ > >> >> >> > This SF.net email is sponsored by Windows: > >> >> >> > > >> >> >> > Build for Windows Store. > >> >> >> > > >> >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> >> > > >> >> >> > > >> >> >> > >> >> > >> > ------------------------------------------------------------------------------ > >> >> >> > This SF.net email is sponsored by Windows: > >> >> >> > > >> >> >> > Build for Windows Store. > >> >> >> > > >> >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> >> > _______________________________________________ > >> >> >> > Hl7api-devel mailing list > >> >> >> > Hl7...@li... > >> >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> >> >> > > >> >> >> > > >> >> >> > >> >> >> -- > >> >> >> View this message in context: > >> >> >> > >> >> > >> > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html > >> >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> > >> > ------------------------------------------------------------------------------ > >> >> >> This SF.net email is sponsored by Windows: > >> >> >> > >> >> >> Build for Windows Store. > >> >> >> > >> >> >> http://p.sf.net/sfu/windows-dev2dev > >> >> >> _______________________________________________ > >> >> >> Hl7api-devel mailing list > >> >> >> Hl7...@li... > >> >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> >> >> > >> >> > > >> >> > > >> >> > >> > ------------------------------------------------------------------------------ > >> >> > This SF.net email is sponsored by Windows: > >> >> > > >> >> > Build for Windows Store. > >> >> > > >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> > _______________________________________________ > >> >> > Hl7api-devel mailing list > >> >> > Hl7...@li... > >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> >> > > >> >> > > >> >> -- > >> >> View this message in context: > >> >> > >> > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html > >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. > >> >> > >> >> > >> >> > >> >> > >> > ------------------------------------------------------------------------------ > >> >> This SF.net email is sponsored by Windows: > >> >> > >> >> Build for Windows Store. > >> >> > >> >> http://p.sf.net/sfu/windows-dev2dev > >> >> _______________________________________________ > >> >> Hl7api-devel mailing list > >> >> Hl7...@li... > >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> >> > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > This SF.net email is sponsored by Windows: > >> > > >> > Build for Windows Store. > >> > > >> > http://p.sf.net/sfu/windows-dev2dev > >> > _______________________________________________ > >> > Hl7api-devel mailing list > >> > Hl7...@li... > >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> > > >> > > >> > >> -- > >> View this message in context: > >> > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642561.html > >> Sent from the hl7api-devel mailing list archive at Nabble.com. > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Windows: > >> > >> Build for Windows Store. > >> > >> http://p.sf.net/sfu/windows-dev2dev > >> _______________________________________________ > >> Hl7api-devel mailing list > >> Hl7...@li... > >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel > >> > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > > Hl7api-devel mailing list > > Hl7...@li... > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > > > > -- > View this message in context: > http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35643630.html > Sent from the hl7api-devel mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > |
From: sagarshah1983 <sag...@ci...> - 2013-06-19 16:30:46
|
Ok. In that case, I think it makes more sense to replicate the code of ADT_AXX and add support for additional event triggers (as suggested by you in previous message). Appreciate your direction. Regards, Sagar Shah James Agnew wrote: > > Hi Sagar, > > Yes, there is definitely nothing wrong with using ADT_A01 to generate > other > types of messages. > > The only challenge you may run into is that some ADT message types will > have structures that ADT_A01 doesn't have. For example, an ADT_A17 has a > second set of PID and PV1 segments, and these segments (which HAPI refers > to as PID2 and PV12) don't exist in the ADT_A01 structure. The workaround > there is to use the addNonStandardSegment method to add them as needed. > This is definitely fine, and is fairly common. > > Cheers, > James > > > On Wed, Jun 19, 2013 at 9:59 AM, sagarshah1983 > <sag...@ci...>wrote: > >> >> Hi James, >> I also had one more question to understand difference between ADT_AXX and >> ADT_A01. >> >> The issues that I am getting is with ADT_AXX. So what if I have to >> replace >> this with ADT_A01. >> Can I used ADT_A01 class to generate ADT A04, A05, A08 and A28 messages >> as >> well? >> I tried generating just MSH and PID segment using ADT_A01 for above >> listed >> different triggers and that atleast worked well. >> >> >> Regards, >> Sagar Shah >> >> James Agnew wrote: >> > >> > Hi All, >> > >> > This does indeed appear to be a bug in the generator for the >> > superstructures unfortunately. Sagar, the good news is that your code >> > *should* work, you're doing the right thing. But the bad news is that >> it >> > isn't working obviously. :) >> > >> > Superstructures are a brand new feature, and they haven't yet been >> heavily >> > used. I've got a fix for this issue locally, but it isn't yet released. >> > >> > One workaround you could easily implement would be to create your own >> > local >> > replacement class for ADT_AXX by copying the source to that class >> > somewhere >> > else and fixing the issue. The source for this class is here (NB this >> is >> > the HL7 v2.4 version): >> > >> http://grepcode.com/file_/repo1.maven.org/maven2/ca.uhn.hapi/hapi-structures-v24/2.1-beta1/ca/uhn/hl7v2/model/v24/message/ADT_AXX.java/?v=source >> > >> > If you look at the "init" method, you see a long string of method calls >> > like this: >> > >> > this.addSuperstructureApplication("MSH", "ADT_A04"); >> > >> > These are the calls which advise HAPI that MSH may be used for an >> ADT_A04 >> > message, but the bug is that there isn't a corresponding line for >> ADT_A01. >> > If you add that, you'll be allowed to add an MSH segment to an A01 >> > message. >> > You'll need to do this for every segment and message type combination >> > though, which I realise will be annoying. >> > >> > I'm going to try and get a fix at least checked in within the next week >> or >> > two... >> > >> > Cheers, >> > James >> > >> > >> > On Wed, Jun 19, 2013 at 5:35 AM, sagarshah1983 >> > <sag...@ci...>wrote: >> > >> >> >> >> Thanks a ton Christian for this. >> >> I think I can make use of Terser to make it generic and use ADT_A01 as >> >> base >> >> message, as there are some issues with ADT_AXX as reported in previous >> >> message. >> >> >> >> >> >> >> >> Christian Ohr-2 wrote: >> >> > >> >> > Yes, I can reproduce this problem. It seems that the MSH segment is >> not >> >> > allowed e.g. for A01 message by the validator, which is obviously >> >> > nonsense. >> >> > Maybe James can enlighten this a bit.... potentially there's a bug >> in >> >> the >> >> > generator. >> >> > >> >> > After all, when creating messages I don't see a need to create >> >> > superstructure messages, as you know which message you create. You >> >> still >> >> > have the problem that there is no common super-class or interface to >> >> ADT >> >> > messages, but their are ways to circumvent this, e.g. using the >> Terser >> >> > class: >> >> > >> >> > Message m = new ADT_A01(); >> >> > m.initQuickstart("ADT", "A01", "P"); >> >> > // everything below works on a generic level >> >> > Terser t = new Terser(m); >> >> > t.set("/MSH-9-2", "A04"); >> >> > t.set("/PID-3-1", "myIdentifier"); >> >> > ... >> >> > >> >> > hope this helps >> >> > Christian >> >> > >> >> > >> >> > 2013/6/19 sagarshah1983 <sag...@ci...> >> >> > >> >> >> >> >> >> Thanks Christian for sharing this link. >> >> >> I was trying to use ADT_AXX structure only, but found few issues >> with >> >> >> generating HL7 message with ADT_AXX and did not find a way to solve >> >> that >> >> >> out. So thought of checking for any other generic structure for ADT >> >> >> messages. >> >> >> Anyways, here's the issue I am facing. >> >> >> Code Snippet. >> >> >> >> >> >> ADT_AXX adt = new ADT_AXX(); >> >> >> MSH msh = adt.getMSH(); >> >> >> .... >> >> >> msh.getMsh9_MessageType().getMsg1_MessageCode().setValue("ADT"); >> >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A28"); >> >> >> >> >> >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A28"); >> >> >> >> >> >> Above works perfectly fine, but the moment I change last two lines >> to >> >> >> reflect A01, it fails. >> >> >> >> >> >> msh.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("A01"); >> >> >> >> >> >> msh.getMsh9_MessageType().getMsg3_MessageStructure().setValue("ADT_A01"); >> >> >> >> >> >> Error details: >> >> >> Caused by: ca.uhn.hl7v2.validation.ValidationException: Message >> >> >> (superstructure ADT_AXX) of type ADT_A01 must not have content in >> MSH >> >> >> >> >> >> Any advice is appreciated. >> >> >> >> >> >> Regards, >> >> >> Sagar Shah >> >> >> >> >> >> >> >> >> >> >> >> Christian Ohr-2 wrote: >> >> >> > >> >> >> > If you are using HAPI 2.1, you should have a look at this: >> >> >> > >> >> >> >> >> >> http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleSuperStructures.html >> >> >> > . >> >> >> > >> >> >> > cheers >> >> >> > Christian >> >> >> > >> >> >> > >> >> >> > 2013/6/18 sagarshah1983 <sag...@ci...> >> >> >> > >> >> >> >> >> >> >> >> That would be really great for me. >> >> >> >> Appreciate your reply and time for the same. >> >> >> >> >> >> >> >> Regards, >> >> >> >> Sagar Shah >> >> >> >> >> >> >> >> LDH-2 wrote: >> >> >> >> > >> >> >> >> > I am not aware of one in 1.x... I don't know 2.x well enough >> yet. >> >> I >> >> >> am >> >> >> >> on >> >> >> >> > the road, but I can send out later the type of code I have >> used >> >> to >> >> >> be >> >> >> >> adt >> >> >> >> > generic. >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > ___________________________________________ >> >> >> >> > Laurent Hasson (via my BlackBerry) >> >> >> >> > email: ld...@36... >> >> >> >> > cell: 646-283-2186 >> >> >> >> > twitter: @ldhasson >> >> >> >> > >> >> >> >> > -----Original Message----- >> >> >> >> > From: sagarshah1983 <sag...@ci...> >> >> >> >> > Date: Tue, 18 Jun 2013 08:53:15 >> >> >> >> > To: <hl7...@li...> >> >> >> >> > Subject: [HAPI-devel] Generic class for ADT message >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> >> > This SF.net email is sponsored by Windows: >> >> >> >> > >> >> >> >> > Build for Windows Store. >> >> >> >> > >> >> >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> >> > This SF.net email is sponsored by Windows: >> >> >> >> > >> >> >> >> > Build for Windows Store. >> >> >> >> > >> >> >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> >> >> > _______________________________________________ >> >> >> >> > Hl7api-devel mailing list >> >> >> >> > Hl7...@li... >> >> >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> -- >> >> >> >> View this message in context: >> >> >> >> >> >> >> >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35639472.html >> >> >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> >> This SF.net email is sponsored by Windows: >> >> >> >> >> >> >> >> Build for Windows Store. >> >> >> >> >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> >> >> _______________________________________________ >> >> >> >> Hl7api-devel mailing list >> >> >> >> Hl7...@li... >> >> >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> >> >> >> >> > >> >> >> > >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> > This SF.net email is sponsored by Windows: >> >> >> > >> >> >> > Build for Windows Store. >> >> >> > >> >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> >> > _______________________________________________ >> >> >> > Hl7api-devel mailing list >> >> >> > Hl7...@li... >> >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > >> >> >> > >> >> >> -- >> >> >> View this message in context: >> >> >> >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642054.html >> >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> This SF.net email is sponsored by Windows: >> >> >> >> >> >> Build for Windows Store. >> >> >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> >> _______________________________________________ >> >> >> Hl7api-devel mailing list >> >> >> Hl7...@li... >> >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> >> >> > >> >> > >> >> >> ------------------------------------------------------------------------------ >> >> > This SF.net email is sponsored by Windows: >> >> > >> >> > Build for Windows Store. >> >> > >> >> > http://p.sf.net/sfu/windows-dev2dev >> >> > _______________________________________________ >> >> > Hl7api-devel mailing list >> >> > Hl7...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35642561.html >> >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> This SF.net email is sponsored by Windows: >> >> >> >> Build for Windows Store. >> >> >> >> http://p.sf.net/sfu/windows-dev2dev >> >> _______________________________________________ >> >> Hl7api-devel mailing list >> >> Hl7...@li... >> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Windows: >> > >> > Build for Windows Store. >> > >> > http://p.sf.net/sfu/windows-dev2dev >> > _______________________________________________ >> > Hl7api-devel mailing list >> > Hl7...@li... >> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35643630.html >> Sent from the hl7api-devel mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> Hl7api-devel mailing list >> Hl7...@li... >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/Generic-class-for-ADT-message-tp35639316p35644330.html Sent from the hl7api-devel mailing list archive at Nabble.com. |