/** * @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); }
return addItem();
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return getIdentifier(); case -332612366: return addBasedOn(); case -995410646: return addPartOf(); case -1017049693: return getQuestionnaireElement(); case -892481550: return getStatusElement(); case -1867885268: return getSubject(); case 1524132147: return getEncounter(); case 1433073514: return getAuthoredElement(); case -1406328437: return getAuthor(); case -896505829: return getSource(); case 3242771: return addItem(); default: return super.makeProperty(hash, name); } }
private void processMetadata() { // todo: can we derive a more informative identifier from the questionnaire if we have a profile if (prebuiltQuestionnaire == null) { questionnaire.addIdentifier().setSystem("urn:ietf:rfc:3986").setValue(questionnaireId); questionnaire.setVersion(profile.getVersion()); questionnaire.setStatus(profile.getStatus()); questionnaire.setDate(profile.getDate()); questionnaire.setPublisher(profile.getPublisher()); Questionnaire.QuestionnaireItemComponent item = new Questionnaire.QuestionnaireItemComponent(); questionnaire.addItem(item); item.getCode().addAll(profile.getKeyword()); questionnaire.setId(nextId("qs")); } if (response != null) { // no identifier - this is transient response.setQuestionnaire("#"+questionnaire.getId()); response.getContained().add(questionnaire); response.setStatus(QuestionnaireResponseStatus.INPROGRESS); QuestionnaireResponse.QuestionnaireResponseItemComponent item = new QuestionnaireResponse.QuestionnaireResponseItemComponent(); response.addItem(item); item.setUserData("object", resource); } }
/** * @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); }
public static org.hl7.fhir.r4.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); copyDomainResource(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); tgt.setQuestionnaireElement(convertReferenceToCanonical(src.getQuestionnaire())); tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); tgt.setSubject(convertReference(src.getSubject())); tgt.setEncounter(convertReference(src.getEncounter())); tgt.setAuthor(convertReference(src.getAuthor())); if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); tgt.setSource(convertReference(src.getSource())); for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); return tgt; }
public org.hl7.fhir.r4.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.instance.model.QuestionnaireResponse src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); copyDomainResource(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); tgt.setQuestionnaireElement(convertReferenceToCanonical(src.getQuestionnaire())); tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); tgt.setSubject(convertReference(src.getSubject())); tgt.setAuthor(convertReference(src.getAuthor())); tgt.setAuthored(src.getAuthored()); tgt.setSource(convertReference(src.getSource())); tgt.setEncounter(convertReference(src.getEncounter())); if (src.hasGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(src.getGroup())); return tgt; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return getIdentifier(); case -332612366: return addBasedOn(); case -995410646: return addPartOf(); case -1017049693: return getQuestionnaireElement(); case -892481550: return getStatusElement(); case -1867885268: return getSubject(); case 1524132147: return getEncounter(); case 1433073514: return getAuthoredElement(); case -1406328437: return getAuthor(); case -896505829: return getSource(); case 3242771: return addItem(); default: return super.makeProperty(hash, name); } }
private void processMetadata() { // todo: can we derive a more informative identifier from the questionnaire if we have a profile if (prebuiltQuestionnaire == null) { questionnaire.addIdentifier().setSystem("urn:ietf:rfc:3986").setValue(questionnaireId); questionnaire.setVersion(profile.getVersion()); questionnaire.setStatus(profile.getStatus()); questionnaire.setDate(profile.getDate()); questionnaire.setPublisher(profile.getPublisher()); Questionnaire.QuestionnaireItemComponent item = new Questionnaire.QuestionnaireItemComponent(); questionnaire.addItem(item); item.getCode().addAll(profile.getKeyword()); questionnaire.setId(nextId("qs")); } if (response != null) { // no identifier - this is transient response.setQuestionnaire("#"+questionnaire.getId()); response.getContained().add(questionnaire); response.setStatus(QuestionnaireResponseStatus.INPROGRESS); QuestionnaireResponse.QuestionnaireResponseItemComponent item = new QuestionnaireResponse.QuestionnaireResponseItemComponent(); response.addItem(item); item.setUserData("object", resource); } }
public org.hl7.fhir.r4.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.instance.model.QuestionnaireResponse src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); copyDomainResource(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); tgt.setQuestionnaireElement(convertReferenceToCanonical(src.getQuestionnaire())); tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); tgt.setSubject(convertReference(src.getSubject())); tgt.setAuthor(convertReference(src.getAuthor())); tgt.setAuthored(src.getAuthored()); tgt.setSource(convertReference(src.getSource())); tgt.setEncounter(convertReference(src.getEncounter())); if (src.hasGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(src.getGroup())); return tgt; }
public static org.hl7.fhir.r4.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); copyDomainResource(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); tgt.setQuestionnaireElement(convertReferenceToCanonical(src.getQuestionnaire())); tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); tgt.setSubject(convertReference(src.getSubject())); tgt.setEncounter(convertReference(src.getEncounter())); tgt.setAuthor(convertReference(src.getAuthor())); if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); tgt.setSource(convertReference(src.getSource())); for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); return tgt; }