Exemple #1
0
 public Enumeration<LinkageType> fromType(Base code) throws FHIRException {
   if (code == null || code.isEmpty()) return null;
   String codeString = ((PrimitiveType) code).asStringValue();
   if (codeString == null || "".equals(codeString)) return null;
   if ("source".equals(codeString))
     return new Enumeration<LinkageType>(this, LinkageType.SOURCE);
   if ("alternate".equals(codeString))
     return new Enumeration<LinkageType>(this, LinkageType.ALTERNATE);
   if ("historical".equals(codeString))
     return new Enumeration<LinkageType>(this, LinkageType.HISTORICAL);
   throw new FHIRException("Unknown LinkageType code '" + codeString + "'");
 }
Exemple #2
0
 public Enumeration<QuantityComparator> fromType(Base code) throws FHIRException {
   if (code == null || code.isEmpty()) return null;
   String codeString = ((PrimitiveType) code).asStringValue();
   if (codeString == null || "".equals(codeString)) return null;
   if ("<".equals(codeString))
     return new Enumeration<QuantityComparator>(this, QuantityComparator.LESS_THAN);
   if ("<=".equals(codeString))
     return new Enumeration<QuantityComparator>(this, QuantityComparator.LESS_OR_EQUAL);
   if (">=".equals(codeString))
     return new Enumeration<QuantityComparator>(this, QuantityComparator.GREATER_OR_EQUAL);
   if (">".equals(codeString))
     return new Enumeration<QuantityComparator>(this, QuantityComparator.GREATER_THAN);
   throw new FHIRException("Unknown QuantityComparator code '" + codeString + "'");
 }