本文整理汇总了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);
}
示例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());
}
示例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());
}