public static Identifiers ExtractPersonIdentifiers(PRPAMT201306UV02ParameterList params) {
    log.debug("Entering HL7Parser201305.ExtractPersonIdentifiers method...");

    Identifiers ids = new Identifiers();
    Identifier id = new Identifier();

    if (params.getLivingSubjectId() != null
        && params.getLivingSubjectId().size() > 0
        && params.getLivingSubjectId().get(0) != null) {
      PRPAMT201306UV02LivingSubjectId livingSubjectId = params.getLivingSubjectId().get(0);

      if (livingSubjectId.getValue() != null
          && livingSubjectId.getValue().size() > 0
          && livingSubjectId.getValue().get(0) != null) {
        II subjectId = livingSubjectId.getValue().get(0);

        if (subjectId.getExtension() != null
            && subjectId.getExtension().length() > 0
            && subjectId.getRoot() != null
            && subjectId.getRoot().length() > 0) {
          id.setId(subjectId.getExtension());
          id.setOrganizationId(subjectId.getRoot());
          log.info(
              "Created id from patient identifier [organization="
                  + id.getOrganizationId()
                  + "][id="
                  + id.getId()
                  + "]");
          ids.add(id);
        } else {
          log.info("message does not contain an id");
        }
      } else {
        log.info("message does not contain an id");
      }
    } else {
      log.info("message does not contain an id");
    }

    log.debug("Exiting HL7Parser201305.ExtractPersonIdentifiers method...");
    return ids;
  }
Esempio n. 2
0
 public static void PrintId(II id, String idname) {
   if (idname == null) {
     idname = "";
   }
   if (!(id == null)) {
     log.info(idname + ".id.root=" + id.getRoot() + ";");
     log.info(idname + ".id.extension=" + id.getExtension() + ";");
   } else {
     log.info("id for " + idname + " is null");
   }
 }