Dao<Questionnaire, Long> dao = getDao(Questionnaire.class); ForeignCollection<Question> questions = dao.getEmptyForeignCollection("questions"); Questionnaire questionnarie = new Questionnaire(); questionnarie.setQuestions(questions); questionnarie.setTitle("Normal"); questionnarie.setDescription("QuestionĂ¡rio normal"); dao.createOrUpdate(questionarie); for(Question question : DataUtil.getAllQuestions()) { // you must set the questionnarie field on the Question // if it is a generated-id, it must be set _after_ it has been created question.setQuestionnaire(questionnarie); questions.add(question); }
private void addCompose(ValueSet retVal, String theSystem, String theCode, String theDisplay) { if (isBlank(theCode)) { return; } ExpansionContains contains = retVal.getExpansion().addContains(); contains.setSystem(theSystem); contains.setCode(theCode); contains.setDisplay(theDisplay); }
private boolean hasLink(String theLinkType, Bundle theBundle) { for (Link next : theBundle.getLink()) { if (theLinkType.equals(next.getRelation())) { return true; } } return false; }
private static void addInitialUrlsToSet(Bundle theBundle, Set<String> theResourcesAlreadyAdded) { for (Bundle.Entry entry : theBundle.getEntry()) { theResourcesAlreadyAdded.add(entry.getFullUrl()); } }
private void addCompose(String theFilter, ValueSet theValueSetToPopulate, ValueSet theSourceValueSet, CodeSystemConcept theConcept) { if (isBlank(theFilter)) { addCompose(theValueSetToPopulate, theSourceValueSet.getCodeSystem().getSystem(), theConcept.getCode(), theConcept.getDisplay()); } else { String filter = theFilter.toLowerCase(); if (theConcept.getDisplay().toLowerCase().contains(filter) || theConcept.getCode().toLowerCase().contains(filter)) { addCompose(theValueSetToPopulate, theSourceValueSet.getCodeSystem().getSystem(), theConcept.getCode(), theConcept.getDisplay()); } } for (CodeSystemConcept nextChild : theConcept.getConcept()) { addCompose(theFilter, theValueSetToPopulate, theSourceValueSet, nextChild); } }
@Read public Patient read(@IdParam IdDt theId) { if (databaseIsDown) { OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverityEnum.FATAL).setDetails("Database is down"); throw new InternalErrorException("Database is down", oo); } Patient patient = new Patient(); // populate this return patient; } //END SNIPPET: returnOO
@Operation(name = "someCustomOperation", idempotent = true, returnParameters = { @OperationParam(name = "return", type = StringDt.class) }) public Parameters someCustomOperation(@IdParam IdDt myId, @OperationParam(name = "dummy") StringDt dummyInput) { Parameters parameters = new Parameters(); parameters.addParameter().setName("return").setValue(new StringDt("My Dummy Result")); return parameters; } // END SNIPPET: jax-rs-provider-operation
@Override protected IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode) { OperationOutcome oo = new OperationOutcome(); oo.getIssueFirstRep().getSeverityElement().setValue(theSeverity); oo.getIssueFirstRep().getDiagnosticsElement().setValue(theMessage); oo.getIssueFirstRep().getCodeElement().setValue(theCode); return oo; }
private int toOrder(Entry theO1) { int o1 = 0; if (theO1.getRequest().getMethodElement().getValueAsEnum() != null) { switch (theO1.getRequest().getMethodElement().getValueAsEnum()) { case DELETE: o1 = 1; break; case POST: o1 = 2; break; case PUT: o1 = 3; break; case GET: o1 = 4; break; } } return o1; }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myActive, myType, myName, myTelecom, myAddress, myPartOf, myContact); }
private static void addAnyResourcesNotAlreadyPresentToBundle(Bundle theAggregatedBundle, Bundle thePartialBundle, Set<String> theResourcesAlreadyAdded) { for (Bundle.Entry entry : thePartialBundle.getEntry()) { if (!theResourcesAlreadyAdded.contains(entry.getFullUrl())) { theResourcesAlreadyAdded.add(entry.getFullUrl()); theAggregatedBundle.getEntry().add(entry); } } }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myActive, myName, myTelecom, myAddress, myGender, myBirthDate, myPhoto, myPractitionerRole, myQualification, myCommunication); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myEvent, myParticipant, mySource, myObject); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUrl, myIdentifier, myVersion, myName, myStatus, myExperimental, myPublisher, myContact, myDate, myLockedDate, myDescription, myUseContext, myImmutable, myRequirements, myCopyright, myExtensible, myCodeSystem, myCompose, myExpansion); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myActive, myName, myTelecom, myGender, myBirthDate, myDeceased, myAddress, myMaritalStatus, myMultipleBirth, myPhoto, myContact, myAnimal, myCommunication, myCareProvider, myManagingOrganization, myLink); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, myNote, myStatus, myManufacturer, myModel, myVersion, myManufactureDate, myExpiry, myUdi, myLotNumber, myOwner, myLocation, myPatient, myContact, myUrl); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myStatus, myName, myDescription, myMode, myType, myTelecom, myAddress, myPhysicalType, myPosition, myManagingOrganization, myPartOf); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myTitle, myCode, mySubject, mySource, myEncounter, myStatus, myDate, myOrderedBy, myMode, myNote, myEntry, myEmptyReason); }