/** * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist */ public QuestionnaireResponseItemComponent getItemFirstRep() { if (getItem().isEmpty()) { addItem(); } return getItem().get(0); }
@Override public Base addChild(String name) throws FHIRException { if (name.equals("linkId")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.linkId"); } else if (name.equals("definition")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.definition"); } else if (name.equals("text")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.text"); } else if (name.equals("answer")) { return addAnswer(); } else if (name.equals("item")) { return addItem(); } else return super.addChild(name); }
private void processExisting(String path, List<QuestionnaireResponse.QuestionnaireResponseItemComponent> answerGroups, List<QuestionnaireResponse.QuestionnaireResponseItemComponent> nResponse) throws FHIRException { // processing existing data for (QuestionnaireResponse.QuestionnaireResponseItemComponent ag : answerGroups) { List<Base> children = ((Element) ag.getUserData("object")).listChildrenByName(tail(path)); for (Base child : children) { if (child != null) { QuestionnaireResponse.QuestionnaireResponseItemComponent ans = ag.addItem(); ans.setUserData("object", child); nResponse.add(ans); } } } }
QuestionnaireResponse.QuestionnaireResponseItemComponent q = g.addItem(); q.setLinkId(g.getLinkId()+"._type"); q.setText("type");
if (child != null) { if (aq == null) { aq = ag.addItem(); aq.setLinkId(result.getLinkId()); aq.setText(result.getText());
@Override public Base addChild(String name) throws FHIRException { if (name.equals("linkId")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.linkId"); } else if (name.equals("definition")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.definition"); } else if (name.equals("text")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.text"); } else if (name.equals("answer")) { return addAnswer(); } else if (name.equals("item")) { return addItem(); } else return super.addChild(name); }
public org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseGroupComponent(org.hl7.fhir.instance.model.QuestionnaireResponse.GroupComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); copyElement(src, tgt); tgt.setLinkId(src.getLinkId()); tgt.setText(src.getText()); // tgt.setSubject(convertReference(src.getSubject())); for (org.hl7.fhir.instance.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); for (org.hl7.fhir.instance.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); return tgt; }
public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); // tgt.setSubject(convertReference(src.getSubject())); for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); return tgt; }
private void processExisting(String path, List<QuestionnaireResponse.QuestionnaireResponseItemComponent> answerGroups, List<QuestionnaireResponse.QuestionnaireResponseItemComponent> nResponse) throws FHIRException { // processing existing data for (QuestionnaireResponse.QuestionnaireResponseItemComponent ag : answerGroups) { List<Base> children = ((Element) ag.getUserData("object")).listChildrenByName(tail(path)); for (Base child : children) { if (child != null) { QuestionnaireResponse.QuestionnaireResponseItemComponent ans = ag.addItem(); ans.setUserData("object", child); nResponse.add(ans); } } } }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1102667083: return getLinkIdElement(); case -1014418093: return getDefinitionElement(); case 3556653: return getTextElement(); case -1412808770: return addAnswer(); case 3242771: return addItem(); default: return super.makeProperty(hash, name); } }
/** * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist */ public QuestionnaireResponseItemComponent getItemFirstRep() { if (getItem().isEmpty()) { addItem(); } return getItem().get(0); }
QuestionnaireResponse.QuestionnaireResponseItemComponent q = g.addItem(); q.setLinkId(g.getLinkId()+"._type"); q.setText("type");
if (child != null) { if (aq == null) { aq = ag.addItem(); aq.setLinkId(result.getLinkId()); aq.setText(result.getText());
public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); // tgt.setSubject(convertReference(src.getSubject())); for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); return tgt; }
public org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseGroupComponent(org.hl7.fhir.instance.model.QuestionnaireResponse.GroupComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); copyElement(src, tgt); tgt.setLinkId(src.getLinkId()); tgt.setText(src.getText()); // tgt.setSubject(convertReference(src.getSubject())); for (org.hl7.fhir.instance.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); for (org.hl7.fhir.instance.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); return tgt; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1102667083: return getLinkIdElement(); case -1014418093: return getDefinitionElement(); case 3556653: return getTextElement(); case -1412808770: return addAnswer(); case 3242771: return addItem(); default: return super.makeProperty(hash, name); } }