/** * Looks up its own event map. If no structure was found, the call is delegated to * the default ModelClassFactory. If nothing can be found, the eventName is returned * as structure. * * @see ca.uhn.hl7v2.parser.AbstractModelClassFactory#getMessageStructureForEvent(java.lang.String, ca.uhn.hl7v2.Version) */ @Override public String getMessageStructureForEvent(String eventName, Version version) throws HL7Exception { String structure = super.getMessageStructureForEvent(eventName, version); if (structure != null) return structure; structure = delegate.getMessageStructureForEvent(eventName, version); return structure != null ? structure : eventName; }
/** * Looks up its own event map. If no structure was found, the call is delegated to * the default ModelClassFactory. If nothing can be found, the eventName is returned * as structure. * * @see ca.uhn.hl7v2.parser.AbstractModelClassFactory#getMessageStructureForEvent(java.lang.String, ca.uhn.hl7v2.Version) */ @Override public String getMessageStructureForEvent(String eventName, Version version) throws HL7Exception { String structure = super.getMessageStructureForEvent(eventName, version); if (structure != null) return structure; structure = delegate.getMessageStructureForEvent(eventName, version); return structure != null ? structure : eventName; }
/** * Given a concatenation of message type and event (e.g. ADT_A04), and the version, finds the * corresponding message structure (e.g. ADT_A01). This is needed because some events share * message structures, although it is not needed when the message structure is explicitly valued * in MSH-9-3. If no mapping is found, returns the original name. * * @throws HL7Exception if there is an error retrieving the map, or if the given version is * invalid * * @deprecated use {@link ModelClassFactory#getMessageStructureForEvent(String, Version)} */ public String getMessageStructureForEvent(String name, String version) throws HL7Exception { assertVersionExists(version); return getHapiContext().getModelClassFactory(). getMessageStructureForEvent(name, Version.versionOf(version)); }
/** * Given a concatenation of message type and event (e.g. ADT_A04), and the version, finds the * corresponding message structure (e.g. ADT_A01). This is needed because some events share * message structures, although it is not needed when the message structure is explicitly valued * in MSH-9-3. If no mapping is found, returns the original name. * * @throws HL7Exception if there is an error retrieving the map, or if the given version is * invalid * * @deprecated use {@link ModelClassFactory#getMessageStructureForEvent(String, Version)} */ public String getMessageStructureForEvent(String name, String version) throws HL7Exception { assertVersionExists(version); return getHapiContext().getModelClassFactory(). getMessageStructureForEvent(name, Version.versionOf(version)); }
String expectedMessageStructure; try { expectedMessageStructure = hapiContext.getModelClassFactory().getMessageStructureForEvent(event, Version.versionOf(version)); } catch (HL7Exception e) { throw new Hl7v2AcceptanceException("Acceptance check failed", ErrorCode.UNKNOWN_KEY_IDENTIFIER);
public Message newMessage(String eventType, String triggerEvent, Version version) throws HL7Exception { try { String structure = getModelClassFactory().getMessageStructureForEvent(eventType + "_" + triggerEvent, version); Class<? extends Message> messageClass = getModelClassFactory().getMessageClass(structure, version.getVersion(), false); Message msg = newMessage(messageClass); ((AbstractMessage) msg).initQuickstart(eventType, triggerEvent, "P"); return msg; } catch (IOException e) { throw new HL7Exception(e); } }
public Message newMessage(String eventType, String triggerEvent, Version version) throws HL7Exception { try { String structure = getModelClassFactory().getMessageStructureForEvent(eventType + "_" + triggerEvent, version); Class<? extends Message> messageClass = getModelClassFactory().getMessageClass(structure, version.getVersion(), false); Message msg = newMessage(messageClass); ((AbstractMessage) msg).initQuickstart(eventType, triggerEvent, "P"); return msg; } catch (IOException e) { throw new HL7Exception(e); } }