예제 #1
0
 private void buildDemoNos(EForm eform, List<Integer> demoList) {
   List<EFormData> eformDataList = eformDataDao.findByFormId(eform.getId());
   for (EFormData eformData : eformDataList) {
     if (!demoList.contains(eformData.getDemographicId()))
       demoList.add(eformData.getDemographicId());
   }
 }
예제 #2
0
  public List<EFormData> findByDemographicId(LoggedInInfo loggedInInfo, Integer demographicId) {
    List<EFormData> results = eFormDataDao.findByDemographicId(demographicId);
    if (results.size() > 0) {
      String resultIds = EForm.getIdsAsStringList(results);
      LogAction.addLogSynchronous(
          loggedInInfo, "FormsManager.findByDemographicId", "ids returned=" + resultIds);
    }

    return (results);
  }
예제 #3
0
  private boolean hasFormUploaded(String formName, Integer demographicNo) {
    List<EFormData> eformDatas =
        eformDataDao.findByDemographicIdAndFormName(demographicNo, formName);
    if (eformDatas == null || eformDatas.isEmpty()) {
      return false;
    }

    for (EFormData eformData : eformDatas) {
      if (checkUploadedToBorn(eformData.getId())) return true;
    }
    return false;
  }
예제 #4
0
  private Integer getMaxFdid(String formName, Integer demographicNo) {
    List<EFormData> eformDatas =
        eformDataDao.findByDemographicIdAndFormName(demographicNo, formName);
    if (eformDatas == null || eformDatas.isEmpty()) {
      logger.warn(formName + " form data not found for patient #" + demographicNo);
      return null;
    }

    Integer fdid = null;
    for (EFormData eformData : eformDatas) {
      if (fdid == null || fdid < eformData.getId()) {
        fdid = eformData.getId();
      }
    }
    if (!checkUploadedToBorn(fdid)) return fdid;
    else return null;
  }
예제 #5
0
  private void recordFormSent(
      Integer demographicNo, Integer rourkeFdid, Integer nddsFdid, Integer report18mFdid) {
    List<Integer> fdids = new ArrayList<Integer>();
    if (rourkeFdid != null) fdids.add(rourkeFdid);
    if (nddsFdid != null) fdids.add(nddsFdid);
    if (report18mFdid != null) fdids.add(report18mFdid);

    for (Integer fdid : fdids) {
      Integer fid = eformDataDao.find(fdid).getFormId();
      EFormValue eformValue = new EFormValue();
      eformValue.setDemographicId(Integer.valueOf(demographicNo));
      eformValue.setFormDataId(fdid);
      eformValue.setFormId(fid);
      eformValue.setVarName(UPLOADED_TO_BORN);
      eformValue.setVarValue(VALUE_YES);
      eformValueDao.persist(eformValue);
    }
  }