Ejemplo n.º 1
0
 private String buildHeader2() {
   spec = "RMB";
   hcFlag = "H";
   healthcardCount++;
   demoSex = oscar.SxmlMisc.getXmlContent(content, "<demosex>", "</demosex>");
   hcLast = demoName.substring(0, demoName.indexOf(",")).toUpperCase();
   hcFirst = demoName.substring(demoName.indexOf(",") + 1).toUpperCase();
   hcLast = hcLast.length() < 9 ? (hcLast + space(9 - hcLast.length())) : (hcLast.substring(0, 9));
   hcFirst =
       hcFirst.length() < 5 ? (hcFirst + space(5 - hcFirst.length())) : (hcFirst.substring(0, 5));
   hcLast.replaceAll("\\W", "");
   hcFirst.replaceAll("\\W", "");
   checkHeader2();
   // patientHeader2 = "\n" + HE + "R" + hcHin + hcLast + hcFirst + demoSex + hcType +
   // space(47) + "\r";
   return ("\n" + HE + "R" + hcHin + hcLast + hcFirst + demoSex + hcType + space(47) + "\r");
 }
Ejemplo n.º 2
0
  private String buildHeader1() {
    referralDoc = "000000";
    hcFlag = ""; // for html content
    m_Flag = ""; // for html content
    referral = oscar.SxmlMisc.getXmlContent(content, "<xml_referral>", "</xml_referral>");
    referralDoc = oscar.SxmlMisc.getXmlContent(content, "<rdohip>", "</rdohip>");
    hcType = oscar.SxmlMisc.getXmlContent(content, "<hctype>", "</hctype>");
    m_review = oscar.SxmlMisc.getXmlContent(content, "<mreview>", "</mreview>");
    m_review = (m_review != null && m_review.equals("checked")) ? "Y" : space(1);
    m_Flag = m_review.equals("Y") ? "M" : "";
    hcFlag =
        (hcType == null || hcType.compareTo("ON") == 0 || hcType.compareTo("") == 0) ? "" : "H";
    if (referral != null && referral.compareTo("checked") == 0) {
      if (referralDoc == null || referralDoc.compareTo("000000") == 0) {
        referral = "";
        referralDoc = space(6);
      } else {
        referral = "R";
        // referralDoc = referralDoc;
      }
    } else {
      referral = "";
      referralDoc = space(6);
    }
    outPatientDateValue =
        (visitDate == null) ? space(8) : UtilDateUtilities.DateToString(visitDate, "yyyyMMdd");
    spec = (specCode != null && specCode.equals("O")) ? "HCP" : "WCB";
    hin = (hin.length() < 12) ? (hin + space(12 - hin.length())) : hin.substring(0, 12);
    hin = hin.toUpperCase();
    count = invNo.length();
    count = 8 - count;
    hcHin = hin; // need for html content

    if (hcFlag.compareTo("H") == 0) {
      patientHeader2 = buildHeader2();
      hin = space(12);
    } else {
      patientHeader2 = "";
    }
    checkHeader1();
    if (visitType == null || visitType.compareTo("00") == 0) {
      patientHeader =
          HE
              + "H"
              + hin
              + dob
              + zero(count)
              + invNo
              + spec
              + "P"
              + referralDoc
              + space(4)
              + space(8)
              + space(4)
              + m_review
              + inPatient
              + space(11)
              + space(6);
    } else {
      patientHeader =
          HE
              + "H"
              + hin
              + dob
              + zero(count)
              + invNo
              + spec
              + "P"
              + referralDoc
              + outPatient
              + outPatientDateValue
              + space(4)
              + m_review
              + inPatient
              + space(11)
              + space(6);
    }
    return ("\n" + patientHeader + "\r" + patientHeader2);
  }