@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("code")) { this.code = castToCode(value); // CodeType } else if (name.equals("display")) { this.display = castToString(value); // StringType } else if (name.equals("definition")) { this.definition = castToString(value); // StringType } else if (name.equals("designation")) { this.getDesignation().add((ConceptDefinitionDesignationComponent) value); } else if (name.equals("property")) { this.getProperty().add((ConceptPropertyComponent) value); } else if (name.equals("concept")) { this.getConcept().add((ConceptDefinitionComponent) value); } else return super.setProperty(name, value); return value; }
/** * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist */ public ConceptPropertyComponent getPropertyFirstRep() { if (getProperty().isEmpty()) { addProperty(); } return getProperty().get(0); }
public static boolean isInactive(CodeSystem cs, ConceptDefinitionComponent def) throws FHIRException { for (ConceptPropertyComponent p : def.getProperty()) { if (p.getCode().equals("status") && p.hasValueStringType()) return "inactive".equals(p.getValueStringType()); } return false; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3059181: // code this.code = castToCode(value); // CodeType return value; case 1671764162: // display this.display = castToString(value); // StringType return value; case -1014418093: // definition this.definition = castToString(value); // StringType return value; case -900931593: // designation this.getDesignation().add((ConceptDefinitionDesignationComponent) value); // ConceptDefinitionDesignationComponent return value; case -993141291: // property this.getProperty().add((ConceptPropertyComponent) value); // ConceptPropertyComponent return value; case 951024232: // concept this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent return value; default: return super.setProperty(hash, name, value); } }
public static org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent(); copyElement(src, tgt); tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); return tgt; }
public static boolean isNotSelectable(CodeSystem cs, ConceptDefinitionComponent def) { for (ConceptPropertyComponent p : def.getProperty()) { if (p.getCode().equals("notSelectable") && p.hasValue() && p.getValue() instanceof BooleanType) return ((BooleanType) p.getValue()).getValue(); } return false; }
public static boolean isDeprecated(CodeSystem cs, ConceptDefinitionComponent def) { for (ConceptPropertyComponent p : def.getProperty()) { if (p.getCode().equals("deprecated") && p.hasValue() && p.getValue() instanceof BooleanType) return ((BooleanType) p.getValue()).getValue(); if (p.getCode().equals("deprecationDate") && p.hasValue() && p.getValue() instanceof DateTimeType) return ((DateTimeType) p.getValue()).before(new DateTimeType()); } return false; }
public static org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent(); copyElement(src, tgt); tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); return tgt; }