Exemplo n.º 1
0
  public String getCCDocs() {
    String docName = "";
    int i = 0;
    try {
      while (!getFullDocName(
              msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getResultCopiesTo(i))
          .equals("")) {
        if (i == 0) {
          docName =
              getFullDocName(
                  msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getResultCopiesTo(i));
        } else {
          docName =
              docName
                  + ", "
                  + getFullDocName(
                      msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getResultCopiesTo(i));
        }
        i++;
      }
      return (docName);
    } catch (Exception e) {
      logger.error("Could not return cc'ed doctors", e);

      return ("");
    }
  }
Exemplo n.º 2
0
  public String getDocName() {
    String docName = "";
    int i = 0;
    try {
      while (!getFullDocName(
              msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getOrderingProvider(i))
          .equals("")) {
        if (i == 0) {
          docName =
              getFullDocName(
                  msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getOrderingProvider(i));
        } else {
          docName =
              docName
                  + ", "
                  + getFullDocName(
                      msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getOrderingProvider(i));
        }
        i++;
      }
      return (docName);
    } catch (Exception e) {
      logger.error("Could not return doctor names", e);

      return ("");
    }
  }
Exemplo n.º 3
0
  public ArrayList<String> getDocNums() {
    ArrayList<String> docNums = new ArrayList<String>();
    String id;
    int i;

    try {
      String providerId =
          msg.getRESPONSE()
              .getORDER_OBSERVATION(0)
              .getOBR()
              .getOrderingProvider(0)
              .getIDNumber()
              .getValue();
      docNums.add(providerId);

      i = 0;
      while ((id =
              msg.getRESPONSE()
                  .getORDER_OBSERVATION(0)
                  .getOBR()
                  .getResultCopiesTo(i)
                  .getIDNumber()
                  .getValue())
          != null) {
        if (!id.equals(providerId)) docNums.add(id);
        i++;
      }
    } catch (Exception e) {
      logger.error("Could not return doctor nums", e);
    }

    return (docNums);
  }
Exemplo n.º 4
0
 public String getOrderStatus() {
   try {
     String orderStatus =
         getString(
             msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getResultStatus().getValue());
     int obrCount = getOBRCount();
     int obxCount;
     int count = 0;
     for (int i = 0; i < obrCount; i++) {
       obxCount = getOBXCount(i);
       for (int j = 0; j < obxCount; j++) {
         String obxStatus = getOBXResultStatus(i, j);
         if (obxStatus.equalsIgnoreCase("C")) count++;
       }
     }
     if (count
         >= 1) { // if any of the OBX's have been corrected, mark the entire report as corrected
       orderStatus = "C";
       return orderStatus;
     } else {
       return orderStatus;
     }
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 5
0
  /*
   *  OBC METHODS
   */
  public String getAccessionNum() {
    try {

      String str =
          msg.getRESPONSE()
              .getORDER_OBSERVATION(0)
              .getORC()
              .getFillerOrderNumber()
              .getEntityIdentifier()
              .getValue();

      String accessionNum = getString(str);

      String[] nums = accessionNum.split("-");
      if (nums.length == 3) {
        return nums[0];
      } else if (nums.length == 5) {
        return nums[0] + "-" + nums[1] + "-" + nums[2];
      } else {

        if (nums.length > 1) return nums[0] + "-" + nums[1];
        else return "";
      }
    } catch (Exception e) {
      logger.error("Could not return accession number", e);

      return ("");
    }
  }
Exemplo n.º 6
0
  /** Retrieve the possible segment headers from the OBX fields */
  public ArrayList<String> getHeaders() {
    int i;
    int arraySize;
    int k = 0;

    ArrayList<String> headers = new ArrayList<String>();
    String currentHeader;

    try {
      for (i = 0; i < msg.getRESPONSE().getORDER_OBSERVATIONReps(); i++) {

        currentHeader = getObservationHeader(i, 0);
        arraySize = headers.size();
        if (arraySize == 0 || !currentHeader.equals(headers.get(arraySize - 1))) {
          logger.info("Adding header: '" + currentHeader + "' to list");
          headers.add(currentHeader);
        }
      }
      return (headers);
    } catch (Exception e) {
      logger.error("Could not create header list", e);

      return (null);
    }
  }
Exemplo n.º 7
0
 public String getOBRComment(int i, int j) {
   try {
     return (getString(
         msg.getRESPONSE().getORDER_OBSERVATION(i).getNTE(j).getComment(0).getValue()));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 8
0
 public String getOBXResult(int i, int j) {
   try {
     return (getString(
         Terser.get(
             msg.getRESPONSE().getORDER_OBSERVATION(i).getOBSERVATION(j).getOBX(), 5, 0, 1, 1)));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 9
0
 public String getMsgDate() {
   // try {
   return (formatDateTime(
       getString(msg.getMSH().getDateTimeOfMessage().getTimeOfAnEvent().getValue())));
   // return(formatDateTime(getString(msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getObservationDateTime().getTimeOfAnEvent().getValue())));
   // } catch (HL7Exception ex) {
   //    return ("");
   // }
 }
Exemplo n.º 10
0
  public String getClientRef() {
    String docNum = "";
    int i = 0;
    try {
      while (!getString(
              msg.getRESPONSE()
                  .getORDER_OBSERVATION(0)
                  .getOBR()
                  .getOrderingProvider(i)
                  .getIDNumber()
                  .getValue())
          .equals("")) {
        if (i == 0) {
          docNum =
              getString(
                  msg.getRESPONSE()
                      .getORDER_OBSERVATION(0)
                      .getOBR()
                      .getOrderingProvider(i)
                      .getIDNumber()
                      .getValue());
        } else {
          docNum =
              docNum
                  + ", "
                  + getString(
                      msg.getRESPONSE()
                          .getORDER_OBSERVATION(0)
                          .getOBR()
                          .getOrderingProvider(i)
                          .getIDNumber()
                          .getValue());
        }
        i++;
      }
      return (docNum);
    } catch (Exception e) {
      logger.error("Could not return doctor id numbers", e);

      return ("");
    }
  }
Exemplo n.º 11
0
  public String getWorkPhone() {
    String phone = "";
    int i = 0;
    try {
      while (!getString(
              msg.getRESPONSE()
                  .getPATIENT()
                  .getPID()
                  .getPhoneNumberBusiness(i)
                  .get9999999X99999CAnyText()
                  .getValue())
          .equals("")) {
        if (i == 0) {
          phone =
              getString(
                  msg.getRESPONSE()
                      .getPATIENT()
                      .getPID()
                      .getPhoneNumberBusiness(i)
                      .get9999999X99999CAnyText()
                      .getValue());
        } else {
          phone =
              phone
                  + ", "
                  + getString(
                      msg.getRESPONSE()
                          .getPATIENT()
                          .getPID()
                          .getPhoneNumberBusiness(i)
                          .get9999999X99999CAnyText()
                          .getValue());
        }
        i++;
      }
      return (phone);
    } catch (Exception e) {
      logger.error("Could not return phone number", e);

      return ("");
    }
  }
Exemplo n.º 12
0
 public String getObservationHeader(int i, int j) {
   try {
     return (getString(
         msg.getRESPONSE()
             .getORDER_OBSERVATION(i)
             .getOBR()
             .getDiagnosticServiceSectionID()
             .getValue()));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 13
0
 public String getOBRName(int i) {
   try {
     return (getString(
         msg.getRESPONSE()
             .getORDER_OBSERVATION(i)
             .getOBR()
             .getUniversalServiceIdentifier()
             .getText()
             .getValue()));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 14
0
 public String getOBXResultStatus(int i, int j) {
   try {
     return (getString(
         msg.getRESPONSE()
             .getORDER_OBSERVATION(i)
             .getOBSERVATION(j)
             .getOBX()
             .getObservResultStatus()
             .getValue()));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 15
0
 public String getOBXReferenceRange(int i, int j) {
   try {
     return (getString(
         msg.getRESPONSE()
             .getORDER_OBSERVATION(i)
             .getOBSERVATION(j)
             .getOBX()
             .getReferencesRange()
             .getValue()));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 16
0
 public String getOBXAbnormalFlag(int i, int j) {
   try {
     return (getString(
         msg.getRESPONSE()
             .getORDER_OBSERVATION(i)
             .getOBSERVATION(j)
             .getOBX()
             .getAbnormalFlags(0)
             .getValue()));
   } catch (Exception e) {
     logger.error("Error retrieving obx abnormal flag", e);
     return ("");
   }
 }
Exemplo n.º 17
0
 public String getOBXName(int i, int j) {
   try {
     return (getString(
         msg.getRESPONSE()
             .getORDER_OBSERVATION(i)
             .getOBSERVATION(j)
             .getOBX()
             .getObservationIdentifier()
             .getText()
             .getValue()));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 18
0
 /*
  *  OBX METHODS
  */
 public int getOBXCount(int i) {
   int count = 0;
   try {
     count = msg.getRESPONSE().getORDER_OBSERVATION(i).getOBSERVATIONReps();
     // if count is 1 there may only be an nte segment and no obx segments so check
     if (count == 1) {
       String test =
           msg.getRESPONSE()
               .getORDER_OBSERVATION(i)
               .getOBSERVATION(0)
               .getOBX()
               .getObservationIdentifier()
               .getText()
               .getValue();
       logger.info("name: " + test);
       if (test == null) count = 0;
     }
   } catch (Exception e) {
     logger.error("Error retrieving obx count", e);
     count = 0;
   }
   return count;
 }
Exemplo n.º 19
0
 public String getOBXUnits(int i, int j) {
   try {
     return (getString(
         msg.getRESPONSE()
             .getORDER_OBSERVATION(i)
             .getOBSERVATION(j)
             .getOBX()
             .getUnits()
             .getIdentifier()
             .getValue()));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 20
0
 public String getRequestDate(int i) {
   try {
     return (formatDateTime(
         getString(
             msg.getRESPONSE()
                 .getORDER_OBSERVATION(i)
                 .getOBR()
                 .getRequestedDateTime()
                 .getTimeOfAnEvent()
                 .getValue())));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 21
0
 public String getServiceDate() {
   try {
     return (formatDateTime(
         getString(
             msg.getRESPONSE()
                 .getORDER_OBSERVATION(0)
                 .getOBR()
                 .getObservationDateTime()
                 .getTimeOfAnEvent()
                 .getValue())));
     // return(formatDateTime(getString(msg.getRESPONSE().getORDER_OBSERVATION(0).getOBR().getObservationDateTime().getTimeOfAnEvent().getValue())));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 22
0
 public String getDOB() {
   try {
     return (formatDateTime(
             getString(
                 msg.getRESPONSE()
                     .getPATIENT()
                     .getPID()
                     .getDateOfBirth()
                     .getTimeOfAnEvent()
                     .getValue()))
         .substring(0, 10));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 23
0
 public String getTimeStamp(int i, int j) {
   try {
     return (formatDateTime(
         getString(
             msg.getRESPONSE()
                 .getORDER_OBSERVATION(i)
                 .getOBSERVATION(j)
                 .getOBX()
                 .getDateTimeOfTheObservation()
                 .getTimeOfAnEvent()
                 .getValue())));
   } catch (Exception e) {
     return ("");
   }
 }
Exemplo n.º 24
0
 public String getLastName() {
   return (getString(
       msg.getRESPONSE().getPATIENT().getPID().getPatientName().getFamilyName().getValue()));
 }
Exemplo n.º 25
0
 public String getFirstName() {
   return (getString(
       msg.getRESPONSE().getPATIENT().getPID().getPatientName().getGivenName().getValue()));
 }
Exemplo n.º 26
0
 public String getHealthNum() {
   return (getString(
       msg.getRESPONSE().getPATIENT().getPID().getPatientIDExternalID().getID().getValue()));
 }
Exemplo n.º 27
0
 public String getPatientLocation() {
   return (getString(msg.getMSH().getSendingFacility().getNamespaceID().getValue()));
 }
Exemplo n.º 28
0
 public int getOBRCount() {
   return (msg.getRESPONSE().getORDER_OBSERVATIONReps());
 }
Exemplo n.º 29
0
 public String getSex() {
   return (getString(msg.getRESPONSE().getPATIENT().getPID().getSex().getValue()));
 }