本文整理汇总了Java中org.oscarehr.common.model.Measurement类的典型用法代码示例。如果您正苦于以下问题:Java Measurement类的具体用法?Java Measurement怎么用?Java Measurement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Measurement类属于org.oscarehr.common.model包,在下文中一共展示了Measurement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assembleMeasurements
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
private List<Measurement> assembleMeasurements(Integer demographicNo) {
// Gather and filter Measurements based on existence of lab_no field
if(rawMeasurements == null) {
rawMeasurements = measurementDao.findByDemographicNo(demographicNo);
}
List<Measurement> cmoMeasurements = new ArrayList<Measurement>();
for(Measurement measurement : rawMeasurements) {
MeasurementsExt labNo = measurementsExtDao.getMeasurementsExtByMeasurementIdAndKeyVal(measurement.getId(), Constants.MeasurementsExtKeys.lab_no.toString());
if(labNo == null) {
cmoMeasurements.add(measurement);
}
}
if(cmoMeasurements.isEmpty()) {
return null;
}
return cmoMeasurements;
}
示例2: getComponent
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public Component4 getComponent(Measurement measurement) {
if(measurement == null) {
this.measurement = new Measurement();
} else {
this.measurement = measurement;
}
Component4 component = new Component4(ActRelationshipHasComponent.HasComponent, new BL(true));
Observation observation = new Observation();
observation.setMoodCode(x_ActMoodDocumentObservation.Eventoccurrence);
observation.setId(getComponentIds());
observation.setCode(getComponentCode());
observation.setText(getComponentText());
observation.setEffectiveTime(getComponentTime());
observation.setValue(getComponentValue());
component.setClinicalStatement(observation);
return component;
}
示例3: write
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
static public void write(Hashtable measure, String demographicNo, String providerNo) {
String inputValue = (String) measure.get("value");
String inputType = (String) measure.get("type");
String mInstrc = (String) measure.get("measuringInstruction");
String comments = (String) measure.get("comments");
String dateObserved = (String) measure.get("dateObserved");
String dateEntered = (String) measure.get("dateEntered");
//write....
Measurement m = new Measurement();
m.setType(inputType);
m.setDemographicId(Integer.parseInt(demographicNo));
m.setProviderNo(providerNo);
m.setDataField(inputValue);
m.setMeasuringInstruction(mInstrc);
m.setComments(comments);
m.setDateObserved(ConversionUtils.fromTimestampString(dateObserved));
dao.persist(m);
}
示例4: toHashTable
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
private static Hashtable<String,Object> toHashTable(Measurement m, MeasurementType mt, Provider p){
Hashtable<String,Object> data = new Hashtable<String,Object>();
data.put("type", mt.getTypeDisplayName());
data.put("typeDisplayName", mt.getTypeDisplayName());
data.put("typeDescription", mt.getTypeDescription());
data.put("value", m.getDataField());
data.put("measuringInstruction", m.getMeasuringInstruction());
data.put("comments", m.getComments());
data.put("dateObserved", ConversionUtils.toTimestampString(m.getDateObserved()));
data.put("dateObserved_date", m.getDateObserved());
data.put("dateEntered", ConversionUtils.toTimestampString(m.getCreateDate()));
data.put("dateEntered_date", m.getCreateDate());
data.put("provider_first", p.getFirstName());
data.put("provider_last", p.getLastName());
return data;
}
示例5: checkLabs
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
protected boolean checkLabs(int demographicNo) {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.YEAR, -1);
boolean labs=false;
//labs over a year
List<Measurement> measures = measurementDao.findByType(demographicNo, "EGFR");
if(measures == null || measures.size() == 0 ||
(measures != null && measures.get(0) != null && measures.get(0).getDateObserved()!= null && measures.get(0).getDateObserved().before(cal.getTime()))) {
MiscUtils.getLogger().debug("Missing EGFR lab");
//we don't have
labs=true;
}
/*
measures = measurementDao.findByType(demographicNo, "ACR");
if(measures == null || measures.size() == 0 || measures.get(0).getDateObserved().before(cal.getTime())) {
MiscUtils.getLogger().info("Missing ACR lab");
//we don't have
labs=true;
}
*/
return labs;
}
示例6: getFormattedCppItemFromMeasurements
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public String getFormattedCppItemFromMeasurements(String header, String measurementType, int demographicNo, int appointmentNo, boolean includePrevious) {
Measurement measurement = measurementDao.getLatestMeasurementByDemographicNoAndType(demographicNo,measurementType);
if(measurement == null) {
return new String();
}
if(!includePrevious) {
if(measurement.getAppointmentNo() != appointmentNo) {
return new String();
}
}
StringBuilder sb = new StringBuilder();
sb.append("\n");
sb.append(measurement.getDataField());
return header + sb.toString();
}
示例7: saveMeasurements
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public static Long saveMeasurements(String type, String demoNo, String providerNo, String dataField, String measuringInstruction, Date dateObserved) {
if (dateObserved==null)
dateObserved = new Date();
Measurement m = new Measurement();
m.setDemographicId(Integer.parseInt(demoNo));
m.setType(type.toUpperCase());
m.setProviderNo(providerNo);
m.setDataField(dataField);
m.setMeasuringInstruction(measuringInstruction);
m.setDateObserved(dateObserved);
measurementDao.persist(m);
return m.getId().longValue();
}
示例8: getAR1Labs
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public ActionForward getAR1Labs(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException {
String demographicNo = request.getParameter("demographicNo");
JSONArray json = new JSONArray();
MeasurementDao md = SpringUtils.getBean(MeasurementDao.class);
List<Measurement> m = md.findByType(Integer.parseInt(demographicNo), "HEMO");
if(m.size()>0) {
json.add(m.get(0));
}
m = md.findByType(Integer.parseInt(demographicNo), "MCV");
if(m.size()>0) {
json.add(m.get(0));
}
response.getWriter().print(json.toString());
return null;
}
示例9: findMatching
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public List<Measurement> findMatching(Measurement measurement) {
String sqlCommand = "select x from Measurement x where x.demographicId=?1 and x.dataField=?2 and x.measuringInstruction=?3 and x.comments=?4 and x.dateObserved=?5 and x.type=?6";
Query query = entityManager.createQuery(sqlCommand);
query.setParameter(1, measurement.getDemographicId());
query.setParameter(2, measurement.getDataField());
query.setParameter(3, measurement.getMeasuringInstruction());
query.setParameter(4, measurement.getComments());
query.setParameter(5, measurement.getDateObserved());
query.setParameter(6, measurement.getType());
List<Measurement> results = query.getResultList();
return results;
}
示例10: getMeasurements
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public HashMap<String, Measurement> getMeasurements(Integer demographicNo, String[] types) {
HashMap<String, Measurement> map = new HashMap<String, Measurement>();
String queryStr = "select m from Measurement m WHERE m.demographicId = :demographicNo AND m.type IN (:types) ORDER BY m.type,m.dateObserved";
Query query = entityManager.createQuery(queryStr);
query.setParameter("demographicNo", demographicNo);
List<String> lst = new ArrayList<String>();
for (int x = 0; x < types.length; x++) {
lst.add(types[x]);
}
query.setParameter("types", lst);
List<Measurement> results = query.getResultList();
for (Measurement m : results) {
map.put(m.getType(), m);
}
return map;
}
示例11: getAppointmentNosByDemographicNoAndType
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public Set<Integer> getAppointmentNosByDemographicNoAndType(int demographicNo, String type, Date startDate, Date endDate) {
Map<Integer, Boolean> results = new HashMap<Integer, Boolean>();
String queryStr = "select m from Measurement m WHERE m.demographicId = ? and m.type=? and m.dateObserved>=? and m.dateObserved<=? ORDER BY m.dateObserved DESC";
Query query = entityManager.createQuery(queryStr);
query.setParameter(1, demographicNo);
query.setParameter(2, type);
query.setParameter(3, startDate);
query.setParameter(4, endDate);
List<Measurement> rs = query.getResultList();
for (Measurement m : rs) {
results.put(m.getAppointmentNo(), true);
}
return results.keySet();
}
示例12: getMeasurementsPriorToDate
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public HashMap<String, Measurement> getMeasurementsPriorToDate(Integer demographicNo, Date d) {
String queryStr = "select m From Measurement m WHERE m.demographicId = ? AND m.dateObserved <= ?";
Query query = entityManager.createQuery(queryStr);
query.setParameter(1, demographicNo);
query.setParameter(2, d);
List<Measurement> rs = query.getResultList();
HashMap<String, Measurement> map = new HashMap<String, Measurement>();
for (Measurement m : rs) {
map.put(m.getType(), m);
}
return map;
}
示例13: getMeasurementObjectByType
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public static List<EctMeasurementsDataBean> getMeasurementObjectByType(String type, Integer demographicNo) {
List<EctMeasurementsDataBean> measurements = new ArrayList<EctMeasurementsDataBean>();
MeasurementDao dao = SpringUtils.getBean(MeasurementDao.class);
for(Object[] i : dao.findMeasurementsAndProvidersByType(type, demographicNo)) {
Measurement m = (Measurement) i[0];
Provider p = (Provider) i[2];
EctMeasurementsDataBean measurement = new EctMeasurementsDataBean();
measurement.setId(m.getId());
measurement.setMeasuringInstrc(m.getMeasuringInstruction());
measurement.setType(m.getType());
measurement.setProviderFirstName(p.getFirstName());
measurement.setProviderLastName(p.getLastName());
measurement.setDataField(m.getDataField());
measurement.setComments(m.getComments());
measurement.setDateObservedAsDate(m.getDateObserved());
measurement.setDateEnteredAsDate(m.getCreateDate());
measurements.add(measurement);
}
return measurements;
}
示例14: ensureOHTCategoryExists
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
/**
* get the oht category, create one if it doesn't already exist
*/
private static MedicalDataTransfer4 ensureOHTCategoryExists(LoggedInInfo loggedInInfo, MyOscarLoggedInInfo myOscarLoggedInInfo, Long patientMyOscarId, Measurement measurement, MeasurementType measurementType) throws IOException, SAXException, ParserConfigurationException, NoSuchItemException_Exception, NotAuthorisedException_Exception, ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedEncodingException_Exception, InvalidRequestException_Exception {
// we'll assume there's not more than 1024 categories.
int MAX_SIZE = 1024;
List<MedicalDataTransfer4> categories = MyOscarMedicalDataManagerUtils.getMedicalData(myOscarLoggedInInfo, patientMyOscarId, MedicalDataType.OTHER_HEALTH_TRACKER_CATEGORY.name(), true, 0, MAX_SIZE);
if (categories.size() >= MAX_SIZE) logger.error("Some one has run into our hard coded limit for categoriy size retrieval.");
for (MedicalDataTransfer4 category : categories) {
category = MyOscarMedicalDataManagerUtils.materialiseDataIfRequired(myOscarLoggedInInfo, category);
String categoryName = getOHTCategoryName(category);
if (categoryName != null && categoryName.equals(measurementType.getType())) return (category);
}
// non exist, create one.
MedicalDataTransfer4 medicalDataTransfer = MyOscarMedicalDataManagerUtils.getEmptyMedicalDataTransfer(myOscarLoggedInInfo, new Date(), measurement.getProviderNo(), measurement.getDemographicId());
medicalDataTransfer.setData(makeOHTCategoryXmlString(measurementType));
medicalDataTransfer.setMedicalDataType(MedicalDataType.OTHER_HEALTH_TRACKER_CATEGORY.name());
// not sure why we're allowed to modify OHT records, but we are... *shrugs*
Long resultId=MyOscarMedicalDataManagerUtils.addMedicalData(loggedInInfo.getLoggedInProviderNo(), myOscarLoggedInInfo, medicalDataTransfer, "OHT_CATEGORY", "OHT_CATEGORY", false, true);
medicalDataTransfer=MyOscarMedicalDataManagerUtils.getMedicalData(myOscarLoggedInInfo, medicalDataTransfer.getOwningPersonId(), resultId);
return (medicalDataTransfer);
}
示例15: doCommentInput
import org.oscarehr.common.model.Measurement; //导入依赖的package包/类
public void doCommentInput(FlowSheetItem item, EctMeasurementTypesBean mtypeBean, MeasurementFlowSheet mFlowsheet, String inputType, String mInstructions, String comment, String date, String apptNo, HttpServletRequest request) {
String demographicNo = request.getParameter("demographic_no");
HttpSession session = request.getSession();
String providerNo = (String) session.getAttribute("user");
String comments = comment;
MeasurementDao measurementDao = (MeasurementDao) SpringUtils.getBean("measurementDao");
Measurement measurement = new Measurement();
measurement.setDemographicId(Integer.parseInt(demographicNo));
measurement.setDataField("");
measurement.setMeasuringInstruction(mInstructions);
measurement.setComments(comments);
measurement.setDateObserved(ConversionUtils.fromDateString(date));
measurement.setType(inputType);
if (apptNo != null) {
measurement.setAppointmentNo(Integer.parseInt(apptNo));
} else {
measurement.setAppointmentNo(0);
}
measurement.setProviderNo(providerNo);
measurementDao.persist(measurement);
}