当前位置: 首页>>代码示例>>Java>>正文


Java AllergyDao.findByDemographicIdUpdatedAfterDate方法代码示例

本文整理汇总了Java中org.oscarehr.common.dao.AllergyDao.findByDemographicIdUpdatedAfterDate方法的典型用法代码示例。如果您正苦于以下问题:Java AllergyDao.findByDemographicIdUpdatedAfterDate方法的具体用法?Java AllergyDao.findByDemographicIdUpdatedAfterDate怎么用?Java AllergyDao.findByDemographicIdUpdatedAfterDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscarehr.common.dao.AllergyDao的用法示例。


在下文中一共展示了AllergyDao.findByDemographicIdUpdatedAfterDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendAllergiesToMyOscar

import org.oscarehr.common.dao.AllergyDao; //导入方法依赖的package包/类
public static void sendAllergiesToMyOscar(LoggedInInfo loggedInInfo, MyOscarLoggedInInfo myOscarLoggedInInfo, Integer demographicId) throws ClassCastException {
	// get last synced info

	// get the items for the person which are changed since last sync
	// for each item
	// send the item or update it

	Date startSyncTime = new Date();
	SentToPHRTracking sentToPHRTracking = MyOscarMedicalDataManagerUtils.getExistingOrCreateInitialSentToPHRTracking(demographicId, OSCAR_ALLERGIES_DATA_TYPE, MyOscarLoggedInInfo.getMyOscarServerBaseUrl());
	logger.debug("sendAllergiesToMyOscar : demographicId=" + demographicId + ", lastSyncTime=" + sentToPHRTracking.getSentDatetime());

	AllergyDao allergyDao = (AllergyDao) SpringUtils.getBean("allergyDao");
	List<Allergy> changedAllergies = allergyDao.findByDemographicIdUpdatedAfterDate(demographicId, sentToPHRTracking.getSentDatetime());
	for (Allergy allergy : changedAllergies) {
		logger.debug("sendAllergiesToMyOscar : allergyId=" + allergy.getId());

		try {
			MedicalDataTransfer4 medicalDataTransfer = toMedicalDataTransfer(loggedInInfo, myOscarLoggedInInfo, allergy);

			// don't ask me why but allergies are currently changeable in oscar, therefore, they're never completed.
			MyOscarMedicalDataManagerUtils.addMedicalData(loggedInInfo.getLoggedInProviderNo(),myOscarLoggedInInfo, medicalDataTransfer, OSCAR_ALLERGIES_DATA_TYPE, allergy.getId(), false, true);
		} catch (Exception e) {
			logger.error("Unexpected error", e);
		}
	}

	sentToPHRTracking.setSentDatetime(startSyncTime);
	sentToPHRTrackingDao.merge(sentToPHRTracking);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:30,代码来源:AllergiesManager.java

示例2: pushAllergies

import org.oscarehr.common.dao.AllergyDao; //导入方法依赖的package包/类
private void pushAllergies(Date lastDataUpdated, Facility facility, DemographicWs demographicService, Integer demographicId) throws ShutdownException {
	logger.debug("pushing demographicAllergies facilityId:" + facility.getId() + ", demographicId:" + demographicId);

	AllergyDao allergyDao = (AllergyDao) SpringUtils.getBean("allergyDao");
	List<Allergy> allergies = allergyDao.findByDemographicIdUpdatedAfterDate(demographicId, lastDataUpdated);
	if (allergies.size() == 0) return;
	ArrayList<CachedDemographicAllergy> cachedAllergies = new ArrayList<CachedDemographicAllergy>();
	
	StringBuilder sentIds = new StringBuilder();

	int i = 0;
	for (Allergy allergy : allergies) {
		CachedDemographicAllergy cachedAllergy = new CachedDemographicAllergy();

		FacilityIdIntegerCompositePk facilityIdIntegerCompositePk = new FacilityIdIntegerCompositePk();
		facilityIdIntegerCompositePk.setCaisiItemId(allergy.getAllergyId());
		cachedAllergy.setFacilityIdIntegerCompositePk(facilityIdIntegerCompositePk);
		
		if(allergy.getAgccs() != null){
		   cachedAllergy.setAgccs(allergy.getAgccs());
		}
		if(allergy.getAgcsp() != null){
			cachedAllergy.setAgcsp(allergy.getAgcsp());
		}
		cachedAllergy.setAgeOfOnset(allergy.getAgeOfOnset());
		cachedAllergy.setCaisiDemographicId(demographicId);
		cachedAllergy.setDescription(allergy.getDescription());
		cachedAllergy.setEntryDate(DateUtils.toGregorianCalendar(allergy.getEntryDate()));
		
		if(allergy.getHiclSeqno() != null){
		   cachedAllergy.setHiclSeqNo(allergy.getHiclSeqno());
		}
		if(allergy.getHicSeqno() !=null){
			cachedAllergy.setHicSeqNo(allergy.getHicSeqno());
		}
		
		cachedAllergy.setLifeStage(allergy.getLifeStage());
		cachedAllergy.setOnSetCode(allergy.getOnsetOfReaction());
		if (allergy.getDrugrefId() != null) cachedAllergy.setPickId(Integer.parseInt(allergy.getDrugrefId()));
		cachedAllergy.setReaction(allergy.getReaction());
		cachedAllergy.setRegionalIdentifier(allergy.getRegionalIdentifier());
		cachedAllergy.setSeverityCode(allergy.getSeverityOfReaction());
		if (allergy.getStartDate() != null) cachedAllergy.setStartDate(DateUtils.toGregorianCalendar(allergy.getStartDate()));
		cachedAllergy.setTypeCode(allergy.getTypeCode());

		cachedAllergies.add(cachedAllergy);
		
		if((++i % 50) == 0) {
			demographicService.setCachedDemographicAllergies(cachedAllergies);
			throttleAndChecks();
			cachedAllergies.clear();
		}

		sentIds.append("," + allergy.getAllergyId());
	}
	
	if(cachedAllergies.size() > 0) {
		demographicService.setCachedDemographicAllergies(cachedAllergies);
		throttleAndChecks();	
	}

	conformanceTestLog(facility, "Allergy", sentIds.toString());
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:64,代码来源:CaisiIntegratorUpdateTask.java

示例3: pushAllergies

import org.oscarehr.common.dao.AllergyDao; //导入方法依赖的package包/类
private void pushAllergies(Date lastDataUpdated, Facility facility, DemographicWs demographicService, Integer demographicId) throws ShutdownException {
	logger.debug("pushing demographicAllergies facilityId:" + facility.getId() + ", demographicId:" + demographicId);

	AllergyDao allergyDao = (AllergyDao) SpringUtils.getBean("allergyDao");
	List<Allergy> allergies = allergyDao.findByDemographicIdUpdatedAfterDate(demographicId, lastDataUpdated);
	if (allergies.size() == 0) return;

	StringBuilder sentIds = new StringBuilder();

	for (Allergy allergy : allergies) {
		CachedDemographicAllergy cachedAllergy = new CachedDemographicAllergy();

		FacilityIdIntegerCompositePk facilityIdIntegerCompositePk = new FacilityIdIntegerCompositePk();
		facilityIdIntegerCompositePk.setCaisiItemId(allergy.getAllergyId());
		cachedAllergy.setFacilityIdIntegerCompositePk(facilityIdIntegerCompositePk);
		
		if(allergy.getAgccs() != null){
		   cachedAllergy.setAgccs(allergy.getAgccs());
		}
		if(allergy.getAgcsp() != null){
			cachedAllergy.setAgcsp(allergy.getAgcsp());
		}
		cachedAllergy.setAgeOfOnset(allergy.getAgeOfOnset());
		cachedAllergy.setCaisiDemographicId(demographicId);
		cachedAllergy.setDescription(allergy.getDescription());
		cachedAllergy.setEntryDate(DateUtils.toGregorianCalendar(allergy.getEntryDate()));
		
		if(allergy.getHiclSeqno() != null){
		   cachedAllergy.setHiclSeqNo(allergy.getHiclSeqno());
		}
		if(allergy.getHicSeqno() !=null){
			cachedAllergy.setHicSeqNo(allergy.getHicSeqno());
		}
		
		cachedAllergy.setLifeStage(allergy.getLifeStage());
		cachedAllergy.setOnSetCode(allergy.getOnsetOfReaction());
		if (allergy.getDrugrefId() != null) cachedAllergy.setPickId(Integer.parseInt(allergy.getDrugrefId()));
		cachedAllergy.setReaction(allergy.getReaction());
		cachedAllergy.setRegionalIdentifier(allergy.getRegionalIdentifier());
		cachedAllergy.setSeverityCode(allergy.getSeverityOfReaction());
		if (allergy.getStartDate() != null) cachedAllergy.setStartDate(DateUtils.toGregorianCalendar(allergy.getStartDate()));
		cachedAllergy.setTypeCode(allergy.getTypeCode());

		ArrayList<CachedDemographicAllergy> cachedAllergies = new ArrayList<CachedDemographicAllergy>();
		cachedAllergies.add(cachedAllergy);
		demographicService.setCachedDemographicAllergies(cachedAllergies);
		throttleAndChecks();

		sentIds.append("," + allergy.getAllergyId());
	}

	conformanceTestLog(facility, "Allergy", sentIds.toString());
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:54,代码来源:CaisiIntegratorUpdateTask.java


注:本文中的org.oscarehr.common.dao.AllergyDao.findByDemographicIdUpdatedAfterDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。