/** * @see org.openmrs.hl7.HL7Service#parseHL7String(String) */ @Override public Message parseHL7String(String hl7Message) throws HL7Exception { // Any pre-parsing for HL7 messages would go here // or a module can use AOP to pre-parse the message // First, try and parse the message Message message; try { message = parser.parse(hl7Message); } catch (EncodingNotSupportedException e) { throw new HL7Exception("HL7 encoding not supported", e); } catch (HL7Exception e) { throw new HL7Exception("Error parsing message", e); } return message; }
throw new HL7Exception("Invalid time format '" + s + "'"); throw new HL7Exception("Invalid time format '" + s + "'"); } else { timeString.append("."); throw new HL7Exception("Invalid time format: '" + s + "' [" + timeString + "]", e);
/** * @see org.openmrs.hl7.HL7Service#processHL7Message(ca.uhn.hl7v2.model.Message) */ @Override public Message processHL7Message(Message message) throws HL7Exception { // Any post-parsing (pre-routing) processing would go here // or a module can use AOP to do the post-parsing Message response; try { if (!router.canProcess(message)) { throw new HL7Exception("No route for hl7 message: " + message.getName() + ". Make sure you have a module installed that registers a hl7handler for this type"); } response = router.processMessage(message); } catch (ApplicationException e) { throw new HL7Exception("Error while processing HL7 message: " + message.getName(), e); } return response; }
throw new HL7Exception("Invalid date '" + s + "'"); throw new HL7Exception("Error parsing date: '" + s.substring(0, 8) + "' for time zone offset'" + s + "'", e); throw new HL7Exception("Invalid date format '" + s + "'"); } else { dateString.append("."); throw new HL7Exception("Error parsing date '" + s + "'");
throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.hl7ConceptId", new Object[] { hl7ConceptId, uid }, null));
Patient patient = createPatient(pid, sendingApp); if (patient == null) { throw new HL7Exception("Couldn't create Patient object from PID");
private Patient getPatient(PID pid) throws HL7Exception { Integer patientId = Context.getHL7Service().resolvePatientId(pid); if (patientId == null) { throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.UnresolvedPatient")); } return Context.getPatientService().getPatient(patientId); }
throw new HL7Exception("Missing patient identifier in PID segment");
private User getEnterer(ORC orc) throws HL7Exception { XCN hl7Enterer = orc.getEnteredBy(0); Integer entererId = Context.getHL7Service().resolveUserId(hl7Enterer); if (entererId == null) { throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.UnresolvedEnterer")); } User enterer = new User(); enterer.setUserId(entererId); return enterer; }
private Location getLocation(PV1 pv1) throws HL7Exception { PL hl7Location = pv1.getAssignedPatientLocation(); Integer locationId = Context.getHL7Service().resolveLocationId(hl7Location); if (locationId == null) { throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.UnresolvedLocation")); } return Context.getLocationService().getLocation(locationId); }
if (facility == null) { // we have no tricks left up our sleeve, so throw new HL7Exception("Error trying to treat PL.pointOfCare '" + pointOfCare + "' as a location.location_id", ex);
throw new HL7Exception(errorMessage);
throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.relationshipCoding", new Object[] { relCodingSystem }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.relationshipType", new Object[] { relIdentifier }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.relationshipType", new Object[] { relIdentifier }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.relationshipTypeNotFound", new Object[] { relTypeId }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.relativeNotCreated"));
throw new HL7Exception("Missing patient identifier in PID segment"); throw new HL7Exception("Cannot find default location"); throw new HL7Exception("PID segment has no recognizable patient identifiers."); throw new HL7Exception("Missing patient name in the PID segment"); throw new HL7Exception("Missing gender in the PID segment"); throw new HL7Exception("Unrecognized gender: " + gender); throw new HL7Exception("Missing birth date in the PID segment");
throw new HL7Exception("hl7InQueue argument cannot be null"); throw new HL7Exception("The hl7InQueue message with id: " + hl7InQueue.getHL7InQueueId() + " is already processing. " + ",key=" + hl7InQueue.getHL7SourceKey() + ")"); } else {
String uuid = getUuidFromIdentifiers(identifiers); if (Context.getPersonService().getPersonByUuid(uuid) != null) { throw new HL7Exception("Non-unique UUID '" + uuid + "' for new person"); throw new HL7Exception("Cannot find default location"); throw new HL7Exception("Missing gender in an NK1 segment"); throw new HL7Exception("Unrecognized gender: " + gender); throw new HL7Exception("Missing birth date in an NK1 segment");
throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.errorInvalidOBR ", new Object[] { messageControlId }, null)); conceptProposals.add(createConceptProposal(encounter, questionConcept, value)); } else { errorInHL7Queue = new HL7Exception(Context.getMessageSourceService().getMessage( "Hl7.proposed.concept.name.empty"), proposingException); break;//stop any further processing of current message throw new HL7Exception(Context.getMessageSourceService().getMessage( "ORUR01.error.improperlyFormattedOBX", new Object[] { PipeParser.encode(obx, new EncodingCharacters('|', "^~\\&")) }, null),
/** * @see org.openmrs.hl7.HL7Service#getUuidFromIdentifiers(ca.uhn.hl7v2.model.v25.datatype.CX[]) */ @Override public String getUuidFromIdentifiers(CX[] identifiers) throws HL7Exception { Boolean found = false; String uuid = null; for (CX identifier : identifiers) { // check for UUID as the assigning authority if (OpenmrsUtil.nullSafeEquals(identifier.getAssigningAuthority().getNamespaceID().getValue(), "UUID")) { // check for duplicates if (found && !OpenmrsUtil.nullSafeEquals(identifier.getIDNumber().getValue(), uuid)) { throw new HL7Exception("multiple UUID values found"); } uuid = identifier.getIDNumber().getValue(); found = true; } } // returns null if not found return uuid; }
throw new HL7Exception(Context.getMessageSourceService().getMessage( "ORUR01.error.notnumericConcept", new Object[] { value, concept.getConceptId(), conceptName.getName(), uid }, null), e); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.invalidAnswer", new Object[] { answer.toString(), uid }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.CannotSetBoolean", new Object[] { obs.getConcept().getConceptId() }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.notnumericConcept", new Object[] { value, concept.getConceptId(), conceptName.getName(), uid }, null), e); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.InvalidConceptId", new Object[] { valueIdentifier, valueName }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.InvalidConceptId", new Object[] { valueIdentifier, valueName }, null)); throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.UpsupportedObsType", new Object[] { hl7Datatype }, null));
form = Context.getFormService().getForm(formId); } catch (NumberFormatException e) { throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.error.parseFormId"), e);