Package ca.uhn.hl7v2.conf

Examples of ca.uhn.hl7v2.conf.ProfileException


                                    + " appears in the message but not in the profile");
                            exList.add(e);
                        }
                    }
                } catch (HL7Exception he) {
                    throw new ProfileException("Problem checking profile", he);
                }
            }
        }
        return toArray(exList);
    }
View Full Code Here


                                "Field " + i + " in " + segment.getName() + " appears in the message but not in the profile");
                            exList.add(e);
                        }
                    }
                } catch (HL7Exception he) {
                    throw new ProfileException("Problem testing against profile", he);
                }
            }
        }    
        return this.toArray(exList);
    }
View Full Code Here

                if (s.length() > 0) {
                    extra.append(s);
                    extra.append(enc.getComponentSeparator());
                }
            } catch (DataTypeException de) {
                throw new ProfileException("Problem testing against profile", de);
            }
        }
       
        if (extra.toString().length() > 0) {
            exList.add(new XElementPresentException("The following components are not defined in the profile: " + extra.toString()));
View Full Code Here

     * content from the xml doc specified by the URI.
     */
    public ProfileCodeStore(String uri) throws ProfileException, IOException {
        try {
            if (uri == null) {
                throw new ProfileException("The input url parameter cannot be null");
            } //end if
            //create tableDoc object
            tableDoc = new SAXBuilder().build(uri);
        } //end try
        catch (ProfileException e) {
            throw e;
        } //end catch
        catch (IOException e){
            throw e;
        }//end catch
        catch (Exception e) {
            throw new ProfileException(e.toString(), e);
        } //end catch
    } //end constructor
View Full Code Here

    } //end constructor

    /** As string constructor but accepts a URL object */
    public ProfileCodeStore(URL url) throws ProfileException, IOException {
        if (url == null)
            throw new ProfileException("The input url parameter cannot be null");
       
        try {           
            tableDoc = new SAXBuilder().build(url);
        } catch (org.jdom.JDOMException e) {
            throw new ProfileException(e.toString(), e);
        }
    }
View Full Code Here

                codeValues[i] = tableElement.getAttributeValue("code");
                i++;
            } //end while
        } //end try
        catch (NullPointerException e) {
            throw new ProfileException("The spec xml table doc is missing one or more of the following: tableElement element, code attribute", e);
        } //end catch
        return codeValues;
    } //end method
View Full Code Here

        Element table = null;
        //Validate the input Profile
        //validateProfile(profileId);
        //Validate the codeSystem
        if (codeSystem == null) {
            throw new ProfileException("The input codeSystem parameter cannot be null");
        } //end if
        if (codeSystem.length() < 4) {
            throw new ProfileException("The input codeSystem parameter cannot be less than 4 characters long");
        } //end if
        try {
            //Extract the last 4 characters from the codeSystem param
            String tableId = codeSystem.substring(codeSystem.length() - 4);
            //System.out.println(tableId);
            XPath path = XPath.newInstance("/Specification/hl7tables/hl7table[@id='" + tableId + "']");
            table = (Element) path.selectSingleNode(tableDoc);
        } //end try
        catch (Exception e) {
            throw new ProfileException(e.toString(), e);
        } //end catch
        return table;
    } //end method
View Full Code Here

        struct.setMax((short) -1);
      } else {
        struct.setMax(Short.parseShort(max));
      }
    } catch (NumberFormatException e) {
      throw new ProfileException("Min and max must be short integers: " + min + ", " + max, e);
    }

    struct.setImpNote(getValueOfFirstElement("ImpNote", elem));
    struct.setDescription(getValueOfFirstElement("Description", elem));
    struct.setReference(getValueOfFirstElement("Reference", elem));
View Full Code Here

    try {
      if (itemNo.length() > 0) {
        field.setItemNo(Short.parseShort(itemNo));
      }
    } catch (NumberFormatException e) {
      throw new ProfileException("Invalid ItemNo: " + itemNo + "( for name " + elem.getAttribute("Name") + ")", e);
    } // try-catch

    try {
      field.setMin(Short.parseShort(min));
      if (max.indexOf('*') >= 0) {
        field.setMax((short) -1);
      } else {
        field.setMax(Short.parseShort(max));
      }
    } catch (NumberFormatException e) {
      throw new ProfileException("Min and max must be short integers: " + min + ", " + max, e);
    }

    parseAbstractComponentData(field, elem);

    int childIndex = 1;
View Full Code Here

    String length = elem.getAttribute("Length");
    if (length != null && length.length() > 0) {
      try {
        comp.setLength(Long.parseLong(length));
      } catch (NumberFormatException e) {
        throw new ProfileException("Length must be a long integer: " + length, e);
      }
    }
    comp.setConstantValue(elem.getAttribute("ConstantValue"));
    String table = elem.getAttribute("Table");
    if (table != null && table.length() > 0) {
      try {
        comp.setTable(table);
      } catch (NumberFormatException e) {
        throw new ProfileException("Table must be a short integer: " + table, e);
      }
    }

    comp.setImpNote(getValueOfFirstElement("ImpNote", elem));
    comp.setDescription(getValueOfFirstElement("Description", elem));
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.conf.ProfileException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.