Beispiel #1
0
  @GET
  @Path("/programList")
  @Produces("application/json")
  public AbstractSearchResponse<ProgramTo1> getProgramList() throws Exception {
    AbstractSearchResponse<ProgramTo1> response = new AbstractSearchResponse<ProgramTo1>();

    List<ProgramProvider> programProviders =
        programManager.getProgramDomain(
            getLoggedInInfo(), getLoggedInInfo().getLoggedInProviderNo());
    if (programProviders != null) {
      List<ProgramTo1> listProgramTo1 = new ArrayList<ProgramTo1>();
      ProgramConverter converter = new ProgramConverter();

      for (ProgramProvider pp : programProviders) {
        Program program =
            programManager.getProgram(getLoggedInInfo(), pp.getProgramId().intValue());
        if (program.getType().equals(Program.BED_TYPE)) {
          listProgramTo1.add(converter.getAsTransferObject(getLoggedInInfo(), program));
        }
      }
      response.setContent(listProgramTo1);
      response.setTotal(listProgramTo1.size());
    }

    return response;
  }
Beispiel #2
0
  @GET
  @Path("/patientList")
  @Produces("application/json")
  public AbstractSearchResponse<AdmissionTo1> getPatientList(
      @QueryParam("programNo") String programNo,
      @QueryParam("day") String day,
      @QueryParam("startIndex") Integer startIndex,
      @QueryParam("numToReturn") Integer numToReturn)
      throws Exception {

    AbstractSearchResponse<AdmissionTo1> response = new AbstractSearchResponse<AdmissionTo1>();

    if (day == null) {
      day = DateFormatUtils.format(Calendar.getInstance(), DateUtils.ISO8601_DATE_PATTERN);
    }

    Date d = new SimpleDateFormat(DateUtils.ISO8601_DATE_PATTERN).parse(day);

    if (programNo == null) {
      // get default
      ProgramProvider current = null;
      ProgramProvider pp =
          programManager.getCurrentProgramInDomain(
              getLoggedInInfo(), getLoggedInInfo().getLoggedInProviderNo());
      if (pp != null) {
        current = pp;
      } else {
        List<ProgramProvider> ppList =
            programManager.getProgramDomain(
                getLoggedInInfo(), getLoggedInInfo().getLoggedInProviderNo());
        if (ppList.size() > 0) {
          current = ppList.get(0);
        }
      }
      if (current != null) {
        programNo = String.valueOf(current.getProgramId());
      }
    }

    if (programNo == null) {
      throw new Exception("Can't get a program for this provider to use as default");
    }

    List<AdmissionTo1> transfers =
        new AdmissionConverter()
            .includeDemographic(true)
            .getAllAsTransferObjects(
                getLoggedInInfo(),
                admissionManager.findAdmissionsByProgramAndDate(
                    getLoggedInInfo(), Integer.parseInt(programNo), d, startIndex, numToReturn));

    response.setContent(transfers);
    response.setTotal(
        admissionManager.findAdmissionsByProgramAndDateAsCount(
            getLoggedInInfo(), Integer.parseInt(programNo), d));

    return response;
  }
Beispiel #3
0
 public List<Program> getAllProgramsByRole(String providerNo, int roleId) {
   List<Program> results = new ArrayList<Program>();
   List<ProgramProvider> ppList = programProviderDAO.getProgramProvidersByProvider(providerNo);
   for (ProgramProvider pp : ppList) {
     if (pp.getRoleId().intValue() == roleId) {
       Program p = programDao.getProgram(pp.getProgramId().intValue());
       results.add(p);
     }
   }
   return results;
 }
Beispiel #4
0
 public List<Program> getActiveProgramByFacility(String providerNo, Integer facilityId) {
   List<Program> programs = new ArrayList<Program>();
   for (ProgramProvider programProvider :
       programProviderDAO.getProgramDomainByFacility(providerNo, facilityId)) {
     Program program = this.getProgram(programProvider.getProgramId());
     if (program.isActive()) {
       programs.add(program);
     }
   }
   return programs;
 }
Beispiel #5
0
  public List<Program> getActiveProgramDomain(String providerNo) {
    List<Program> programDomain = new ArrayList<Program>();

    for (Iterator<?> i = programProviderDAO.getActiveProgramDomain(providerNo).iterator();
        i.hasNext(); ) {
      ProgramProvider programProvider = (ProgramProvider) i.next();
      Program p = getProgram(programProvider.getProgramId());
      if (p != null) programDomain.add(p);
    }

    return programDomain;
  }
  public int addOneClaimHeaderRecord(LoggedInInfo loggedInInfo, BillingClaimHeader1Data val) {
    BillingONCHeader1 b = new BillingONCHeader1();
    b.setHeaderId(0);
    b.setTranscId(val.transc_id);
    b.setRecId(val.rec_id);
    b.setHin(val.hin);
    b.setVer(val.ver);
    b.setDob(val.dob);
    b.setPayProgram(val.pay_program);
    b.setPayee(val.payee);
    b.setRefNum(val.ref_num);
    b.setFaciltyNum(val.facilty_num);
    if (val.admission_date.length() > 0)
      try {
        b.setAdmissionDate(dateformatter.parse(val.admission_date));
      } catch (ParseException e) {
        /*empty*/
      }

    b.setRefLabNum(val.ref_lab_num);
    b.setManReview(val.man_review);
    b.setLocation(val.location);
    b.setDemographicNo(Integer.parseInt(val.demographic_no));
    b.setProviderNo(val.provider_no);
    String apptNo = StringUtils.trimToNull(val.appointment_no);

    if (apptNo != null) {
      b.setAppointmentNo(Integer.parseInt(val.appointment_no));
    } else {
      b.setAppointmentNo(null);
    }

    b.setDemographicName(StringEscapeUtils.escapeSql(val.demographic_name));
    b.setSex(val.sex);
    b.setProvince(val.province);
    if (val.billing_date.length() > 0)
      try {
        b.setBillingDate(dateformatter.parse(val.billing_date));
      } catch (ParseException e) {
        /*empty*/
      }
    if (val.billing_time.length() > 0)
      try {
        b.setBillingTime(timeFormatter.parse(val.billing_time));
      } catch (ParseException e) {
        MiscUtils.getLogger().error("Invalid time", e);
      }

    b.setTotal(new BigDecimal(val.total == null ? "0.00" : val.total));

    if (val.paid == null || val.paid.isEmpty()) {
      b.setPaid(new BigDecimal("0.00"));
    } else {
      b.setPaid(new BigDecimal(val.paid));
    }

    b.setStatus(val.status);
    b.setComment(StringEscapeUtils.escapeSql(val.comment));
    b.setVisitType(val.visittype);
    b.setProviderOhipNo(val.provider_ohip_no);
    b.setProviderRmaNo(val.provider_rma_no);
    b.setApptProviderNo(val.apptProvider_no);
    b.setAsstProviderNo(val.asstProvider_no);
    b.setCreator(val.creator);
    b.setClinic(val.clinic);

    ProgramProvider pp =
        programManager2.getCurrentProgramInDomain(
            loggedInInfo, loggedInInfo.getLoggedInProviderNo());

    if (pp != null) {
      b.setProgramNo(pp.getProgramId().intValue());
    }

    cheaderDao.persist(b);

    return b.getId();
  }