本文整理汇总了Java中org.oscarehr.common.model.PreventionExt类的典型用法代码示例。如果您正苦于以下问题:Java PreventionExt类的具体用法?Java PreventionExt怎么用?Java PreventionExt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PreventionExt类属于org.oscarehr.common.model包,在下文中一共展示了PreventionExt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPreventionWithExts
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public void addPreventionWithExts(Prevention prevention, HashMap<String, String> exts) {
if (prevention == null) return;
preventionDao.persist(prevention);
if (exts != null) {
for (String keyval : exts.keySet()) {
if (StringUtils.filled(keyval) && StringUtils.filled(exts.get(keyval))) {
PreventionExt preventionExt = new PreventionExt();
preventionExt.setPreventionId(prevention.getId());
preventionExt.setKeyval(keyval);
preventionExt.setVal(exts.get(keyval));
preventionExtDao.persist(preventionExt);
}
}
}
}
示例2: toTransfer
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
/**
* both preventionsExts are required, null is not allowed, pass in empty list for no ext's
*/
public static PreventionTransfer toTransfer(Prevention prevention, List<PreventionExt> preventionExts) {
if (prevention == null) return (null);
PreventionTransfer preventionTransfer = new PreventionTransfer();
preventionTransfer.setCreationDate(prevention.getCreationDate());
preventionTransfer.setCreatorProviderNo(prevention.getCreatorProviderNo());
preventionTransfer.setDeleted(prevention.isDeleted());
preventionTransfer.setDemographicId(prevention.getDemographicId());
preventionTransfer.setId(prevention.getId());
preventionTransfer.setLastUpdateDate(prevention.getLastUpdateDate());
preventionTransfer.setNever(prevention.isNever());
preventionTransfer.setNextDate(prevention.getNextDate());
preventionTransfer.setPreventionDate(prevention.getPreventionDate());
preventionTransfer.setPreventionType(prevention.getPreventionType());
preventionTransfer.setProviderNo(prevention.getProviderNo());
preventionTransfer.setRefused(prevention.isRefused());
preventionTransfer.setPreventionExts(PreventionExtTransfer.toTransfers(preventionExts));
return (preventionTransfer);
}
示例3: getPreventionDataFromExt
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public static ArrayList<Map<String, Object>> getPreventionDataFromExt(String extKey, String extVal) {
ArrayList<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
try {
List<PreventionExt> preventionExts = preventionExtDao.findByKeyAndValue(extKey, extVal);
for (PreventionExt preventionExt : preventionExts) {
Map<String, Object> hash = getPreventionById(preventionDao.find(preventionExt.getPreventionId()).toString());
if (hash.get("deleted") != null && ((String) hash.get("deleted")).equals("0")) {
list.add(hash);
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return list;
}
示例4: getExtValues
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
/**
*Method to get a list of (demographic #, prevention dates, and key values) of a certain type <injectionTppe> from a start Date to an end Date with a Ext key value EG get all
* Rh injection's product #, from 2006-12-12 to 2006-12-18
*
*/
public static ArrayList<Map<String, Object>> getExtValues(String injectionType, Date startDate, Date endDate, String keyVal) {
ArrayList<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
List<Prevention> preventions = preventionDao.findByTypeAndDate(injectionType, startDate, endDate);
for (Prevention prevention : preventions) {
List<PreventionExt> preventionExts = preventionExtDao.findByPreventionIdAndKey(prevention.getId(), keyVal);
try {
for (PreventionExt preventionExt : preventionExts) {
Map<String, Object> h = new HashMap<String, Object>();
h.put("preventions_id", prevention.getId().toString());
h.put("demographic_no", prevention.getDemographicId().toString());
h.put("val", preventionExt.getVal());
h.put("prevention_date", prevention.getPreventionDate());
list.add(h);
break;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
return list;
}
示例5: getPreventionComment
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public static String getPreventionComment(String id) {
log.debug("Calling getPreventionComment " + id);
String comment = null;
try {
List<PreventionExt> preventionExts = preventionExtDao.findByPreventionIdAndKey(Integer.valueOf(id), "comments");
for (PreventionExt preventionExt : preventionExts) {
comment = preventionExt.getVal();
if (comment != null && comment.trim().equals("")) comment = null;
break;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return comment;
}
示例6: getPreventionDataFromExt
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public static ArrayList<Map<String,Object>> getPreventionDataFromExt(String extKey, String extVal) {
ArrayList<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
try {
List<PreventionExt> preventionExts = preventionExtDao.findByKeyAndValue(extKey, extVal);
for (PreventionExt preventionExt : preventionExts) {
Map<String,Object> hash = getPreventionById(preventionDao.find(preventionExt.getPreventionId()).toString());
if (hash.get("deleted") != null && ((String) hash.get("deleted")).equals("0")) {
list.add(hash);
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return list;
}
示例7: getExtValues
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
/**
*Method to get a list of (demographic #, prevention dates, and key values) of a certain type <injectionTppe> from a start Date to an end Date with a Ext key value EG get all
* Rh injection's product #, from 2006-12-12 to 2006-12-18
*
*/
public static ArrayList<Map<String,Object>> getExtValues(String injectionType, Date startDate, Date endDate, String keyVal) {
ArrayList<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
List<Prevention> preventions = preventionDao.findByTypeAndDate(injectionType, startDate, endDate);
for (Prevention prevention : preventions) {
List<PreventionExt> preventionExts = preventionExtDao.findByPreventionIdAndKey(prevention.getId(), keyVal);
try {
for (PreventionExt preventionExt : preventionExts) {
Map<String,Object> h = new HashMap<String,Object>();
h.put("preventions_id", prevention.getId().toString());
h.put("demographic_no", prevention.getDemographicId().toString());
h.put("val", preventionExt.getVal());
h.put("prevention_date", prevention.getPreventionDate());
list.add(h);
break;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
return list;
}
示例8: getPreventionComment
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public static String getPreventionComment(String id) {
log.debug("Calling getPreventionComment " + id);
String comment = null;
try {
List<PreventionExt> preventionExts = preventionExtDao.findByPreventionIdAndKey(Integer.valueOf(id), "comments");
for (PreventionExt preventionExt : preventionExts) {
comment = preventionExt.getVal();
if (comment!=null && comment.trim().equals("")) comment = null;
break;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return comment;
}
示例9: populateImmunizationData
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
private void populateImmunizationData(PatientInfo patientInfo, Integer demographicNo) {
List<Prevention> preventions = preventionDao.findActiveByDemoId(demographicNo);
if (preventions.isEmpty()) {
return;
}
ImmunizationData immunizationData = patientInfo.addNewImmunizationData();
for(Prevention prevention:preventions) {
Vaccine vaccine = immunizationData.addNewVaccine();
List<PreventionExt> exts = preventionExtDao.findByPreventionId(prevention.getId());
vaccine.setDateReceived(new XmlCalendar(dateFormatter.format(prevention.getPreventionDate())));
vaccine.setVaccineName(prevention.getPreventionType());
/*
immunizationData.setVaccineDIN(arg0);
immunizationData.setDoseNum(arg0);
immunizationData.setExpiryDate(arg0);
immunizationData.setInitials(arg0);
immunizationData.setInjectionSite(arg0);
*/
for(PreventionExt ext:exts) {
if("lot".equals(ext.getkeyval())) {
vaccine.setLotNumber(ext.getVal());
} else if("comments".equals(ext.getkeyval())) {
vaccine.setComments(ext.getVal());
}
}
}
}
示例10: getTransfers
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public static PreventionTransfer[] getTransfers(LoggedInInfo loggedInInfo, List<Prevention> preventions)
{
ArrayList<PreventionTransfer> results=new ArrayList<PreventionTransfer>();
PreventionManager preventionManager=SpringUtils.getBean(PreventionManager.class);
for (Prevention prevention : preventions)
{
List<PreventionExt> preventionExts = preventionManager.getPreventionExtByPrevention(loggedInInfo,prevention.getId());
PreventionTransfer preventionTransfer=PreventionTransfer.toTransfer(prevention, preventionExts);
results.add(preventionTransfer);
}
return(results.toArray(new PreventionTransfer[0]));
}
示例11: toTransfer
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
/**
* We will not support null key entries
*/
public static PreventionExtTransfer toTransfer(PreventionExt preventionExt) {
if (preventionExt==null) return(null);
PreventionExtTransfer transfer = new PreventionExtTransfer();
transfer.setId(preventionExt.getId());
transfer.setPreventionId(preventionExt.getPreventionId());
transfer.setKey(preventionExt.getkeyval());
transfer.setValue(preventionExt.getVal());
return (transfer);
}
示例12: toTransfers
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public static PreventionExtTransfer[] toTransfers(List<PreventionExt> preventionExts) {
ArrayList<PreventionExtTransfer> results = new ArrayList<PreventionExtTransfer>();
for (PreventionExt preventionExt : preventionExts) {
results.add(toTransfer(preventionExt));
}
return (results.toArray(new PreventionExtTransfer[0]));
}
示例13: getPrevention
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public PreventionTransfer getPrevention(Integer preventionId) {
LoggedInInfo loggedInInfo=getLoggedInInfo();
Prevention prevention = preventionManager.getPrevention(loggedInInfo,preventionId);
if (prevention != null) {
List<PreventionExt> preventionExts = preventionManager.getPreventionExtByPrevention(loggedInInfo,prevention.getId());
return (PreventionTransfer.toTransfer(prevention, preventionExts));
}
return (null);
}
示例14: Immunization
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public Immunization(Prevention prevention, List<PreventionExt> preventionExt) {
if(prevention != null) {
this.prevention = prevention;
}
if(preventionExt != null) {
for(PreventionExt extElement : preventionExt) {
this.preventionMap.put(extElement.getkeyval(), extElement.getVal());
}
}
}
示例15: findByPreventionId
import org.oscarehr.common.model.PreventionExt; //导入依赖的package包/类
public List<PreventionExt> findByPreventionId(Integer preventionId) {
Query query = entityManager.createQuery("select x from PreventionExt x where preventionId=?1");
query.setParameter(1, preventionId);
@SuppressWarnings("unchecked")
List<PreventionExt> results = query.getResultList();
return (results);
}