public String getMappingForResultStatusLookup(ResultStatus resultStatusInstance, TaxonomyType extSystem) { if(resultStatusInstance == null || extSystem == null || extSystem.getText() == null) return null; String query = "select lm.extCode from LookupInstance as li left join li.mappings as lm where (li.id = :ResultStatusId and lm.extSystem = :TaxonomyType) "; List<?> list = getDomainFactory().find(query, new String[] {"ResultStatusId", "TaxonomyType"}, new Object[] {resultStatusInstance.getID(), extSystem.getText()}); if(list != null && list.size() > 0) { if(list.get(0) instanceof String) return (String) list.get(0); } return null; }
private String getOrderStatus(ResultStatus resultStatus) { if(resultStatus == null) return null; if(ResultStatus.PROVISIONAL.equals(resultStatus)) return PROVISIONAL; else if(ResultStatus.FINAL.equals(resultStatus)) return FINAL; return resultStatus.getText(); }
private void fillPATHInvestigationFromOBR(IfOrderInvestigationVo invVo, OBR obr, IfInvestigationLiteVo cfgInv,ProviderSystemVo providerSystem) throws Exception { LOG.debug("R01VoMapper fillPATHInvestigationFromOBR: entry"); invVo.setInvestigation(cfgInv); invVo.setFillerOrdNum(obr.getFillerOrderNumber().getEntityIdentifier().getValue()); invVo.setResultStatus((ResultStatus) svc.getLocalLookup(ResultStatus.class, ResultStatus.TYPE_ID, providerSystem.getCodeSystem().getText(), obr.getResultStatus().getValue())); //http://jira/browse/WDEV-15552 SPS sps = obr.getSpecimenSource(); LookupInstVo resultSpecimenSource=svc.getLocalLookup(LookupInstVo.class, ResultSpecimenTypes.TYPE_ID, providerSystem.getCodeSystem().getText(), sps.getSpecimenSourceNameOrCode().getIdentifier().getValue().trim()); invVo.setResultSpecimenType(resultSpecimenSource); //End http://jira/browse/WDEV-15552 // wdev-2746 ResultStatus must map to a valid lookup value if (obr.getResultStatus().getValue() != null && !invVo.getResultStatusIsNotNull()) throw new HL7Exception("ResultStatus (OBR-25) does not map to a valid local lookup (ResultStatus) - Message Rejected"); if (obr.getRequestedDateTime() != null && obr.getRequestedDateTime().getTimeOfAnEvent().getValue() != null) { invVo.setDisplayDateTime(populateDateTimeVoFromTS(obr.getRequestedDateTime())); invVo.setDisplayTimeSupplied( Boolean.valueOf(isTimeSupplied(obr.getRequestedDateTime()))); invVo.setDisplayFlag(OcsDisplayFlag.REQUESTED); } if (obr.getResultsRptStatusChngDateTime() != null && obr.getResultsRptStatusChngDateTime().getTimeOfAnEvent().getValue() != null) { DateTime dt = populateDateTimeVoFromTS(obr.getResultsRptStatusChngDateTime()); //JME: 20061205: Change to handle WinPath sending 189912300000 in OBR.22 instead of a null date/time if (!dt.equals(new DateTime("189912300000"))) { invVo.setDisplayDateTime(dt); invVo.setRepDateTime(dt); invVo.setResultSortDate(dt);//http://jira/browse/WDEV-18025 invVo.setRepTimeSupplied( Boolean.valueOf(isTimeSupplied(obr.getResultsRptStatusChngDateTime()))); invVo.setDisplayFlag(OcsDisplayFlag.REPORTED); invVo.setDisplayTimeSupplied(invVo.getRepTimeSupplied()); } } if (obr.getSpecimenReceivedDateTime() != null && obr.getSpecimenReceivedDateTime().getTimeOfAnEvent().getValue() != null) { invVo.setDisplayDateTime(populateDateTimeVoFromTS(obr.getSpecimenReceivedDateTime())); invVo.setDisplayFlag(OcsDisplayFlag.SPEC_RECVD); invVo.setDisplayTimeSupplied( Boolean.valueOf(isTimeSupplied(obr.getSpecimenReceivedDateTime()))); // WDEV-16384 - Check if expected turnaround values configured. If they are, calculated the expected result datetime invVo.setExpectedDateTime(ocsIfInbound.calculateExpectedDateTime(invVo.getInvestigation(), invVo.getDisplayDateTime())); } if (obr.getObservationDateTime() != null && obr.getObservationDateTime().getTimeOfAnEvent().getValue() != null) { invVo.setDisplayDateTime(populateDateTimeVoFromTS(obr.getObservationDateTime())); invVo.setDisplayFlag(OcsDisplayFlag.SPEC_COLL); invVo.setDisplayTimeSupplied( Boolean.valueOf(isTimeSupplied(obr.getObservationDateTime()))); } /* * etc investVo.setOrderPriority(); investVo.setOrdInvCurrentStatus(); */ LOG.debug("R01VoMapper fillPATHInvestigationFromOBR: exit"); }
private void fillRADInvestigationFromOBR(IfOrderInvestigationVo invVo, OBR obr, IfInvestigationLiteVo cfgInv,ProviderSystemVo providerSystem) throws Exception { LOG.debug("R01VoMapper fillRADInvestigationFromOBR: entry"); invVo.setInvestigation(cfgInv); invVo.setFillerOrdNum(obr.getFillerOrderNumber().getEntityIdentifier().getValue()); invVo.setResultStatus((ResultStatus) svc.getLocalLookup(ResultStatus.class, ResultStatus.TYPE_ID, providerSystem.getCodeSystem().getText(), obr.getResultStatus().getValue())); // http://jira/browse/WDEV-9727 String accession = obr.getFillerField2().getValue(); if (accession!=null && !Hl7Null.equals(accession)) { invVo.setAccessionNumber(accession); } // wdev-2746 ResultStatus must map to a valid lookup value if (obr.getResultStatus().getValue() != null && !invVo.getResultStatusIsNotNull()) throw new HL7Exception("ResultStatus (OBR-25) does not map to a valid local lookup (ResultStatus) - Message Rejected"); if (obr.getRequestedDateTime() != null && obr.getRequestedDateTime().getTimeOfAnEvent().getValue() !=null) { invVo.setDisplayDateTime(populateDateTimeVoFromTS(obr.getRequestedDateTime())); invVo.setDisplayFlag(OcsDisplayFlag.REQUESTED); invVo.setDisplayTimeSupplied( Boolean.valueOf(isTimeSupplied(obr.getRequestedDateTime()))); } if (obr.getObservationDateTime() != null && obr.getObservationDateTime().getTimeOfAnEvent().getValue() != null) { invVo.setDisplayDateTime(populateDateTimeVoFromTS(obr.getObservationDateTime())); invVo.setDisplayFlag(OcsDisplayFlag.EXAMINED); invVo.setDisplayTimeSupplied( Boolean.valueOf(isTimeSupplied(obr.getObservationDateTime()))); // WDEV-16384 - Check if expected turnaround values configured. If they are, calculated the expected result datetime invVo.setExpectedDateTime(ocsIfInbound.calculateExpectedDateTime(invVo.getInvestigation(), invVo.getDisplayDateTime())); } if (obr.getResultsRptStatusChngDateTime() != null && obr.getResultsRptStatusChngDateTime().getTimeOfAnEvent().getValue() != null) { invVo.setRepDateTime(populateDateTimeVoFromTS(obr.getResultsRptStatusChngDateTime())); invVo.setResultSortDate(populateDateTimeVoFromTS(obr.getResultsRptStatusChngDateTime())); //http://jira/browse/WDEV-18025 invVo.setRepTimeSupplied( Boolean.valueOf(isTimeSupplied(obr.getResultsRptStatusChngDateTime()))); } else { invVo.setRepDateTime(null); invVo.setResultSortDate(null); //http://jira/browse/WDEV-18025 invVo.setRepTimeSupplied(Boolean.FALSE); // invVo.setDisplayFlag(OcsDisplayFlag.REQUESTED); // invVo.setDisplayTimeSupplied(false); // invVo.setDisplayDateTime(populateDateTimeVoFromTS(obr.getObservationDateTime())); } /* * etc investVo.setOrderPriority(); investVo.setOrdInvCurrentStatus(); */ LOG.debug("R01VoMapper fillRADInvestigationFromOBR: exit"); }
/** * @param msgVo * @param newOrder * @param order * @throws HL7Exception * @throws DataTypeException */ private void populateNonSpecimenClinicalDetailsSeparateSegments(IfOrderInvestigationVo inv,ProviderSystemVo providerSystem, IfOutOcsOrderVo newOrder, ORM_O01 order,boolean useNTE) throws HL7Exception, DataTypeException { GeneralQuestionAnswerVoCollection radiologyQuestions = ocsIf.getRadiologyQuestions(inv); if ((radiologyQuestions!=null&&radiologyQuestions.size()>0) ||newOrder.getAdditClinNotesIsNotNull() ||newOrder.getSummaryClinicalInformationIsNotNull()) { int i=0; String FT = svc.getRemoteLookup(ResultValueType.FT.getId(), providerSystem.getCodeSystem().getText()); String orderDetail= svc.getRemoteLookup(ResultStatus.ORDERDETAIL.getId(), providerSystem.getCodeSystem().getText()); if(!useNTE) { i++; renderOBX(getNextOBX(order, i), i, "Relevant clinical information : ", FT, orderDetail); // Only needed for OBXs } String alertText = getAlertsText(newOrder.getPatient(),providerSystem); if (alertText!=null&&!alertText.equals("")) { i++; if(useNTE) renderNTE(getNextNTE(order, i), alertText,i); else renderOBX(getNextOBX(order, i), i, alertText, FT, orderDetail); } for (GeneralQuestionAnswerVo qAVo : radiologyQuestions) { String answers = UserAssessmentInstHelper.getAnswersAsText(qAVo); if(answers!=null) { i++; if(useNTE) renderNTE(getNextNTE(order, i),qAVo.getQuestion().getShortText()+": "+ answers, i); else renderOBX(getNextOBX(order, i), i, answers, FT, orderDetail,qAVo.getQuestion().getShortText()); } } if (newOrder.getAdditClinNotesIsNotNull()) { i++; if(useNTE) renderNTE(getNextNTE(order, i), newOrder.getAdditClinNotes(),i); else renderOBX(getNextOBX(order, i), i, newOrder.getAdditClinNotes(), FT, orderDetail); } if(newOrder.getSummaryClinicalInformationIsNotNull()) { i++; if(useNTE) renderNTE(getNextNTE(order, i),newOrder.getSummaryClinicalInformation(),i); else renderOBX(getNextOBX(order, i),i,newOrder.getSummaryClinicalInformation(),FT,orderDetail); } if(inv.getReorderReasonIsNotNull()&&!"".equals(inv.getReorderReason())) { i++; if(useNTE) renderNTE(getNextNTE(order, i),"Reason for Re-Order: "+inv.getReorderReason(),i); else renderOBX(getNextOBX(order, i),i,"Reason for Re-Order: "+inv.getReorderReason(),FT,orderDetail); } } }
public String getMappingForResultStatusLookup(ResultStatus resultStatusInstance, TaxonomyType extSystem) { ResultDialog impl = (ResultDialog) getDomainImpl(PathologyDialogImpl.class); return impl.getMappingForResultStatusLookup(resultStatusInstance, extSystem); }