/** * 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; }
/** * 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; }
String messageControlId = msh.getMessageControlID().getValue(); log.debug("Found HL7 message in inbound queue with control id = " + messageControlId);
String hl7PersonId = identifier.getIDNumber().getValue();
private Provider getProvider(PV1 pv1) throws HL7Exception { XCN hl7Provider = pv1.getAttendingDoctor(0); Provider provider = null; String id = hl7Provider.getIDNumber().getValue(); String assignAuth = hl7Provider.getAssigningAuthority().getUniversalID().getValue(); String type = hl7Provider.getAssigningAuthority().getUniversalIDType().getValue(); String errorMessage;
String facility = pl.getFacility().getUniversalID().getValue();
String identifierType = identifier.getNamespaceID().getValue(); if (OpenmrsUtil.nullSafeEquals(identifierType, HL7Constants.HL7_FORM_UUID)) { uuid = identifier.getEntityIdentifier().getValue(); } else if (OpenmrsUtil.nullSafeEquals(identifierType, HL7Constants.HL7_FORM_ID)) { id = identifier.getEntityIdentifier().getValue(); } else { log.warn("Form identifier type of " + identifierType + " unknown to ORU R01 processor.");
String hl7PatientId = id.getIDNumber().getValue(); name.setFamilyName(patientNameX.getFamilyName().getSurname().getValue()); name.setGivenName(patientNameX.getGivenName().getValue()); name.setMiddleName(patientNameX.getSecondAndFurtherGivenNamesOrInitialsThereof().getValue()); if (creator != null) { name.setCreator(creator);
String messageControlId = msh.getMessageControlID().getValue(); if (log.isDebugEnabled()) { log.debug("Found HL7 message in inbound queue with control id = " + messageControlId); if (!StringUtils.hasText(obr.getUniversalServiceIdentifier().getIdentifier().getValue())) { throw new HL7Exception(Context.getMessageSourceService().getMessage("ORUR01.errorInvalidOBR ", new Object[] { messageControlId }, null));
log.debug(" CWE observation"); CWE value = (CWE) obx5; String valueIdentifier = value.getIdentifier().getValue(); log.debug(" value id = " + valueIdentifier); String valueName = value.getText().getValue(); log.debug(" value name = " + valueName); if (isConceptProposal(valueIdentifier)) { if (HL7Constants.HL7_LOCAL_DRUG.equals(value.getNameOfAlternateCodingSystem().getValue())) { Drug valueDrug = new Drug(); valueDrug.setDrugId(Integer.valueOf(value.getAlternateIdentifier().getValue())); obs.setValueDrug(valueDrug); } else { String valueIdentifier = value.getIdentifier().getValue(); String valueName = value.getText().getValue(); if (isConceptProposal(valueIdentifier)) { throw new ProposingConceptException(concept, valueName); if (value == null || value.getValue() == null || value.getValue().trim().length() == 0) { log.warn("Not creating null valued obs for concept " + concept); return null; obs.setValueText(value.getValue()); } else if ("ED".equals(hl7Datatype)) { ED value = (ED) obx5;
String relIdentifier = nk1.getRelationship().getIdentifier().getValue();
Integer encounterId = null; try { encounterId = Integer.valueOf(visitNumber.getIDNumber().getValue());