/** * Derive a concept name from the CWE component of an hl7 message. * * @param altIdentifier * @param altCodingSystem * @return */ private ConceptName getConceptName(ST altIdentifier, ID altCodingSystem) throws HL7Exception { if (altIdentifier != null && HL7Constants.HL7_LOCAL_CONCEPT_NAME.equals(altCodingSystem.getValue())) { String hl7ConceptNameId = altIdentifier.getValue(); return getConceptName(hl7ConceptNameId); } return null; }
message.getMSH().getEncodingCharacters().setValue("^~\\&"); message.getMSH().getFieldSeparator().setValue("|"); obr.getFillerOrderNumber().getEntityIdentifier().setValue("1234"); obr.getFillerOrderNumber().getNamespaceID().setValue("LAB"); obr.getUniversalServiceIdentifier().getIdentifier().setValue("88304"); obx.getObservationIdentifier().getIdentifier().setValue("88304"); obx.getObservationSubID().setValue("1"); ce.getIdentifier().setValue("T57000"); ce.getText().setValue("GALLBLADDER"); ce.getNameOfCodingSystem().setValue("SNM"); Varies value = obx.getObservationValue(0); obx.getObservationSubID().setValue("1"); observationIdentifier.setValue("88304"); ST extraSubcomponent = new ST(message); extraSubcomponent.setValue("MDT"); observationIdentifier.getExtraComponents().getComponent(0).setData(extraSubcomponent );
/** * Get an openmrs Concept object out of the given hl7 coded with exceptions element * * @param codedElement cwe to pull from * @param uid unique string for this message for any error reporting purposes * @return new Concept object * @throws HL7Exception if parsing errors occur */ private Concept getConcept(CWE codedElement, String uid) throws HL7Exception { String hl7ConceptId = codedElement.getIdentifier().getValue(); String codingSystem = codedElement.getNameOfCodingSystem().getValue(); return getConcept(hl7ConceptId, codingSystem, uid); }
/** * Get an openmrs Concept object out of the given hl7 coded element * * @param codedElement ce to pull from * @param uid unique string for this message for any error reporting purposes * @return new Concept object * @throws HL7Exception if parsing errors occur */ private Concept getConcept(CE codedElement, String uid) throws HL7Exception { String hl7ConceptId = codedElement.getIdentifier().getValue(); String codingSystem = codedElement.getNameOfCodingSystem().getValue(); return getConcept(hl7ConceptId, codingSystem, uid); }
/** * @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; }
/** {@inheritDoc} */ protected Type createNewTypeWithoutReflection(int field) { switch (field) { case 0: return new ST(getMessage()); default: return null; } }
String messageControlId = msh.getMessageControlID().getValue(); log.debug("Found HL7 message in inbound queue with control id = " + messageControlId);
String hl7PersonId = identifier.getIDNumber().getValue();