use of org.hl7.fhir.r5.model.Library in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeLibraryLibraryLibraryComponent.
protected void composeLibraryLibraryLibraryComponent(Complex parent, String parentType, String name, Library.LibraryLibraryComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "library", name, element, index);
if (element.hasNameElement())
composeString(t, "Library", "name", element.getNameElement(), -1);
if (element.hasIdentifierElement())
composeString(t, "Library", "identifier", element.getIdentifierElement(), -1);
if (element.hasVersionElement())
composeString(t, "Library", "version", element.getVersionElement(), -1);
if (element.hasDocument())
composeType(t, "Library", "document", element.getDocument(), -1);
}
use of org.hl7.fhir.r5.model.Library in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeMeasure.
protected void composeMeasure(Complex parent, String parentType, String name, Measure element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "Measure", name, element, index);
if (element.hasUrlElement())
composeUri(t, "Measure", "url", element.getUrlElement(), -1);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Measure", "identifier", element.getIdentifier().get(i), i);
if (element.hasVersionElement())
composeString(t, "Measure", "version", element.getVersionElement(), -1);
if (element.hasNameElement())
composeString(t, "Measure", "name", element.getNameElement(), -1);
if (element.hasTitleElement())
composeString(t, "Measure", "title", element.getTitleElement(), -1);
if (element.hasSubtitleElement())
composeString(t, "Measure", "subtitle", element.getSubtitleElement(), -1);
if (element.hasStatusElement())
composeEnum(t, "Measure", "status", element.getStatusElement(), -1);
if (element.hasExperimentalElement())
composeBoolean(t, "Measure", "experimental", element.getExperimentalElement(), -1);
if (element.hasSubject())
composeType(t, "Measure", "subject", element.getSubject(), -1);
if (element.hasDateElement())
composeDateTime(t, "Measure", "date", element.getDateElement(), -1);
if (element.hasPublisherElement())
composeString(t, "Measure", "publisher", element.getPublisherElement(), -1);
for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "Measure", "contact", element.getContact().get(i), i);
if (element.hasDescriptionElement())
composeMarkdown(t, "Measure", "description", element.getDescriptionElement(), -1);
for (int i = 0; i < element.getUseContext().size(); i++) composeUsageContext(t, "Measure", "useContext", element.getUseContext().get(i), i);
for (int i = 0; i < element.getJurisdiction().size(); i++) composeCodeableConcept(t, "Measure", "jurisdiction", element.getJurisdiction().get(i), i);
if (element.hasPurposeElement())
composeMarkdown(t, "Measure", "purpose", element.getPurposeElement(), -1);
if (element.hasUsageElement())
composeString(t, "Measure", "usage", element.getUsageElement(), -1);
if (element.hasCopyrightElement())
composeMarkdown(t, "Measure", "copyright", element.getCopyrightElement(), -1);
if (element.hasApprovalDateElement())
composeDate(t, "Measure", "approvalDate", element.getApprovalDateElement(), -1);
if (element.hasLastReviewDateElement())
composeDate(t, "Measure", "lastReviewDate", element.getLastReviewDateElement(), -1);
if (element.hasEffectivePeriod())
composePeriod(t, "Measure", "effectivePeriod", element.getEffectivePeriod(), -1);
for (int i = 0; i < element.getTopic().size(); i++) composeCodeableConcept(t, "Measure", "topic", element.getTopic().get(i), i);
for (int i = 0; i < element.getAuthor().size(); i++) composeContactDetail(t, "Measure", "author", element.getAuthor().get(i), i);
for (int i = 0; i < element.getEditor().size(); i++) composeContactDetail(t, "Measure", "editor", element.getEditor().get(i), i);
for (int i = 0; i < element.getReviewer().size(); i++) composeContactDetail(t, "Measure", "reviewer", element.getReviewer().get(i), i);
for (int i = 0; i < element.getEndorser().size(); i++) composeContactDetail(t, "Measure", "endorser", element.getEndorser().get(i), i);
for (int i = 0; i < element.getRelatedArtifact().size(); i++) composeRelatedArtifact(t, "Measure", "relatedArtifact", element.getRelatedArtifact().get(i), i);
for (int i = 0; i < element.getLibrary().size(); i++) composeCanonical(t, "Measure", "library", element.getLibrary().get(i), i);
if (element.hasDisclaimerElement())
composeMarkdown(t, "Measure", "disclaimer", element.getDisclaimerElement(), -1);
if (element.hasScoring())
composeCodeableConcept(t, "Measure", "scoring", element.getScoring(), -1);
if (element.hasCompositeScoring())
composeCodeableConcept(t, "Measure", "compositeScoring", element.getCompositeScoring(), -1);
for (int i = 0; i < element.getType().size(); i++) composeCodeableConcept(t, "Measure", "type", element.getType().get(i), i);
if (element.hasRiskAdjustmentElement())
composeString(t, "Measure", "riskAdjustment", element.getRiskAdjustmentElement(), -1);
if (element.hasRateAggregationElement())
composeString(t, "Measure", "rateAggregation", element.getRateAggregationElement(), -1);
if (element.hasRationaleElement())
composeMarkdown(t, "Measure", "rationale", element.getRationaleElement(), -1);
if (element.hasClinicalRecommendationStatementElement())
composeMarkdown(t, "Measure", "clinicalRecommendationStatement", element.getClinicalRecommendationStatementElement(), -1);
if (element.hasImprovementNotation())
composeCodeableConcept(t, "Measure", "improvementNotation", element.getImprovementNotation(), -1);
for (int i = 0; i < element.getDefinition().size(); i++) composeMarkdown(t, "Measure", "definition", element.getDefinition().get(i), i);
if (element.hasGuidanceElement())
composeMarkdown(t, "Measure", "guidance", element.getGuidanceElement(), -1);
for (int i = 0; i < element.getGroup().size(); i++) composeMeasureMeasureGroupComponent(t, "Measure", "group", element.getGroup().get(i), i);
for (int i = 0; i < element.getSupplementalData().size(); i++) composeMeasureMeasureSupplementalDataComponent(t, "Measure", "supplementalData", element.getSupplementalData().get(i), i);
}
use of org.hl7.fhir.r5.model.Library in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composePlanDefinition.
protected void composePlanDefinition(Complex parent, String parentType, String name, PlanDefinition element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "PlanDefinition", name, element, index);
if (element.hasUrlElement())
composeUri(t, "PlanDefinition", "url", element.getUrlElement(), -1);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "PlanDefinition", "identifier", element.getIdentifier().get(i), i);
if (element.hasVersionElement())
composeString(t, "PlanDefinition", "version", element.getVersionElement(), -1);
if (element.hasNameElement())
composeString(t, "PlanDefinition", "name", element.getNameElement(), -1);
if (element.hasTitleElement())
composeString(t, "PlanDefinition", "title", element.getTitleElement(), -1);
if (element.hasSubtitleElement())
composeString(t, "PlanDefinition", "subtitle", element.getSubtitleElement(), -1);
if (element.hasType())
composeCodeableConcept(t, "PlanDefinition", "type", element.getType(), -1);
if (element.hasStatusElement())
composeEnum(t, "PlanDefinition", "status", element.getStatusElement(), -1);
if (element.hasExperimentalElement())
composeBoolean(t, "PlanDefinition", "experimental", element.getExperimentalElement(), -1);
if (element.hasSubject())
composeType(t, "PlanDefinition", "subject", element.getSubject(), -1);
if (element.hasDateElement())
composeDateTime(t, "PlanDefinition", "date", element.getDateElement(), -1);
if (element.hasPublisherElement())
composeString(t, "PlanDefinition", "publisher", element.getPublisherElement(), -1);
for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "PlanDefinition", "contact", element.getContact().get(i), i);
if (element.hasDescriptionElement())
composeMarkdown(t, "PlanDefinition", "description", element.getDescriptionElement(), -1);
for (int i = 0; i < element.getUseContext().size(); i++) composeUsageContext(t, "PlanDefinition", "useContext", element.getUseContext().get(i), i);
for (int i = 0; i < element.getJurisdiction().size(); i++) composeCodeableConcept(t, "PlanDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
if (element.hasPurposeElement())
composeMarkdown(t, "PlanDefinition", "purpose", element.getPurposeElement(), -1);
if (element.hasUsageElement())
composeString(t, "PlanDefinition", "usage", element.getUsageElement(), -1);
if (element.hasCopyrightElement())
composeMarkdown(t, "PlanDefinition", "copyright", element.getCopyrightElement(), -1);
if (element.hasApprovalDateElement())
composeDate(t, "PlanDefinition", "approvalDate", element.getApprovalDateElement(), -1);
if (element.hasLastReviewDateElement())
composeDate(t, "PlanDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
if (element.hasEffectivePeriod())
composePeriod(t, "PlanDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
for (int i = 0; i < element.getTopic().size(); i++) composeCodeableConcept(t, "PlanDefinition", "topic", element.getTopic().get(i), i);
for (int i = 0; i < element.getAuthor().size(); i++) composeContactDetail(t, "PlanDefinition", "author", element.getAuthor().get(i), i);
for (int i = 0; i < element.getEditor().size(); i++) composeContactDetail(t, "PlanDefinition", "editor", element.getEditor().get(i), i);
for (int i = 0; i < element.getReviewer().size(); i++) composeContactDetail(t, "PlanDefinition", "reviewer", element.getReviewer().get(i), i);
for (int i = 0; i < element.getEndorser().size(); i++) composeContactDetail(t, "PlanDefinition", "endorser", element.getEndorser().get(i), i);
for (int i = 0; i < element.getRelatedArtifact().size(); i++) composeRelatedArtifact(t, "PlanDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
for (int i = 0; i < element.getLibrary().size(); i++) composeCanonical(t, "PlanDefinition", "library", element.getLibrary().get(i), i);
for (int i = 0; i < element.getGoal().size(); i++) composePlanDefinitionPlanDefinitionGoalComponent(t, "PlanDefinition", "goal", element.getGoal().get(i), i);
for (int i = 0; i < element.getAction().size(); i++) composePlanDefinitionPlanDefinitionActionComponent(t, "PlanDefinition", "action", element.getAction().get(i), i);
}
use of org.hl7.fhir.r5.model.Library in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeActivityDefinition.
protected void composeActivityDefinition(Complex parent, String parentType, String name, ActivityDefinition element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "ActivityDefinition", name, element, index);
if (element.hasUrlElement())
composeUri(t, "ActivityDefinition", "url", element.getUrlElement(), -1);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "ActivityDefinition", "identifier", element.getIdentifier().get(i), i);
if (element.hasVersionElement())
composeString(t, "ActivityDefinition", "version", element.getVersionElement(), -1);
if (element.hasNameElement())
composeString(t, "ActivityDefinition", "name", element.getNameElement(), -1);
if (element.hasTitleElement())
composeString(t, "ActivityDefinition", "title", element.getTitleElement(), -1);
if (element.hasSubtitleElement())
composeString(t, "ActivityDefinition", "subtitle", element.getSubtitleElement(), -1);
if (element.hasStatusElement())
composeEnum(t, "ActivityDefinition", "status", element.getStatusElement(), -1);
if (element.hasExperimentalElement())
composeBoolean(t, "ActivityDefinition", "experimental", element.getExperimentalElement(), -1);
if (element.hasSubject())
composeType(t, "ActivityDefinition", "subject", element.getSubject(), -1);
if (element.hasDateElement())
composeDateTime(t, "ActivityDefinition", "date", element.getDateElement(), -1);
if (element.hasPublisherElement())
composeString(t, "ActivityDefinition", "publisher", element.getPublisherElement(), -1);
for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "ActivityDefinition", "contact", element.getContact().get(i), i);
if (element.hasDescriptionElement())
composeMarkdown(t, "ActivityDefinition", "description", element.getDescriptionElement(), -1);
for (int i = 0; i < element.getUseContext().size(); i++) composeUsageContext(t, "ActivityDefinition", "useContext", element.getUseContext().get(i), i);
for (int i = 0; i < element.getJurisdiction().size(); i++) composeCodeableConcept(t, "ActivityDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
if (element.hasPurposeElement())
composeMarkdown(t, "ActivityDefinition", "purpose", element.getPurposeElement(), -1);
if (element.hasUsageElement())
composeString(t, "ActivityDefinition", "usage", element.getUsageElement(), -1);
if (element.hasCopyrightElement())
composeMarkdown(t, "ActivityDefinition", "copyright", element.getCopyrightElement(), -1);
if (element.hasApprovalDateElement())
composeDate(t, "ActivityDefinition", "approvalDate", element.getApprovalDateElement(), -1);
if (element.hasLastReviewDateElement())
composeDate(t, "ActivityDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
if (element.hasEffectivePeriod())
composePeriod(t, "ActivityDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
for (int i = 0; i < element.getTopic().size(); i++) composeCodeableConcept(t, "ActivityDefinition", "topic", element.getTopic().get(i), i);
for (int i = 0; i < element.getAuthor().size(); i++) composeContactDetail(t, "ActivityDefinition", "author", element.getAuthor().get(i), i);
for (int i = 0; i < element.getEditor().size(); i++) composeContactDetail(t, "ActivityDefinition", "editor", element.getEditor().get(i), i);
for (int i = 0; i < element.getReviewer().size(); i++) composeContactDetail(t, "ActivityDefinition", "reviewer", element.getReviewer().get(i), i);
for (int i = 0; i < element.getEndorser().size(); i++) composeContactDetail(t, "ActivityDefinition", "endorser", element.getEndorser().get(i), i);
for (int i = 0; i < element.getRelatedArtifact().size(); i++) composeRelatedArtifact(t, "ActivityDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
for (int i = 0; i < element.getLibrary().size(); i++) composeCanonical(t, "ActivityDefinition", "library", element.getLibrary().get(i), i);
if (element.hasKindElement())
composeEnum(t, "ActivityDefinition", "kind", element.getKindElement(), -1);
if (element.hasProfileElement())
composeCanonical(t, "ActivityDefinition", "profile", element.getProfileElement(), -1);
if (element.hasCode())
composeCodeableConcept(t, "ActivityDefinition", "code", element.getCode(), -1);
if (element.hasIntentElement())
composeEnum(t, "ActivityDefinition", "intent", element.getIntentElement(), -1);
if (element.hasPriorityElement())
composeEnum(t, "ActivityDefinition", "priority", element.getPriorityElement(), -1);
if (element.hasDoNotPerformElement())
composeBoolean(t, "ActivityDefinition", "doNotPerform", element.getDoNotPerformElement(), -1);
if (element.hasTiming())
composeType(t, "ActivityDefinition", "timing", element.getTiming(), -1);
if (element.hasLocation())
composeReference(t, "ActivityDefinition", "location", element.getLocation(), -1);
for (int i = 0; i < element.getParticipant().size(); i++) composeActivityDefinitionActivityDefinitionParticipantComponent(t, "ActivityDefinition", "participant", element.getParticipant().get(i), i);
if (element.hasProduct())
composeType(t, "ActivityDefinition", "product", element.getProduct(), -1);
if (element.hasQuantity())
composeQuantity(t, "ActivityDefinition", "quantity", element.getQuantity(), -1);
for (int i = 0; i < element.getDosage().size(); i++) composeDosage(t, "ActivityDefinition", "dosage", element.getDosage().get(i), i);
for (int i = 0; i < element.getBodySite().size(); i++) composeCodeableConcept(t, "ActivityDefinition", "bodySite", element.getBodySite().get(i), i);
for (int i = 0; i < element.getSpecimenRequirement().size(); i++) composeReference(t, "ActivityDefinition", "specimenRequirement", element.getSpecimenRequirement().get(i), i);
for (int i = 0; i < element.getObservationRequirement().size(); i++) composeReference(t, "ActivityDefinition", "observationRequirement", element.getObservationRequirement().get(i), i);
for (int i = 0; i < element.getObservationResultRequirement().size(); i++) composeReference(t, "ActivityDefinition", "observationResultRequirement", element.getObservationResultRequirement().get(i), i);
if (element.hasTransformElement())
composeCanonical(t, "ActivityDefinition", "transform", element.getTransformElement(), -1);
for (int i = 0; i < element.getDynamicValue().size(); i++) composeActivityDefinitionActivityDefinitionDynamicValueComponent(t, "ActivityDefinition", "dynamicValue", element.getDynamicValue().get(i), i);
}
use of org.hl7.fhir.r5.model.Library in project org.hl7.fhir.core by hapifhir.
the class BaseWorkerContext method fetchResourceWithException.
@SuppressWarnings("unchecked")
public <T extends Resource> T fetchResourceWithException(String cls, String uri, CanonicalResource source) throws FHIRException {
if (uri == null) {
return null;
}
if ("StructureDefinition".equals(cls)) {
uri = ProfileUtilities.sdNs(uri, getOverrideVersionNs());
}
synchronized (lock) {
String version = null;
if (uri.contains("|")) {
version = uri.substring(uri.lastIndexOf("|") + 1);
uri = uri.substring(0, uri.lastIndexOf("|"));
}
if (uri.contains("#")) {
uri = uri.substring(0, uri.indexOf("#"));
}
if (cls == null || "Resource".equals(cls)) {
if (structures.has(uri)) {
return (T) structures.get(uri, version);
}
if (guides.has(uri)) {
return (T) guides.get(uri, version);
}
if (capstmts.has(uri)) {
return (T) capstmts.get(uri, version);
}
if (measures.has(uri)) {
return (T) measures.get(uri, version);
}
if (libraries.has(uri)) {
return (T) libraries.get(uri, version);
}
if (valueSets.has(uri)) {
return (T) valueSets.get(uri, version);
}
if (codeSystems.has(uri)) {
return (T) codeSystems.get(uri, version);
}
if (operations.has(uri)) {
return (T) operations.get(uri, version);
}
if (searchParameters.has(uri)) {
return (T) searchParameters.get(uri, version);
}
if (plans.has(uri)) {
return (T) plans.get(uri, version);
}
if (maps.has(uri)) {
return (T) maps.get(uri, version);
}
if (transforms.has(uri)) {
return (T) transforms.get(uri, version);
}
if (questionnaires.has(uri)) {
return (T) questionnaires.get(uri, version);
}
for (Map<String, ResourceProxy> rt : allResourcesById.values()) {
for (ResourceProxy r : rt.values()) {
if (uri.equals(r.getUrl())) {
return (T) r.getResource();
}
}
}
} else if ("ImplementationGuide".equals(cls)) {
return (T) guides.get(uri, version);
} else if ("CapabilityStatement".equals(cls)) {
return (T) capstmts.get(uri, version);
} else if ("Measure".equals(cls)) {
return (T) measures.get(uri, version);
} else if ("Library".equals(cls)) {
return (T) libraries.get(uri, version);
} else if ("StructureDefinition".equals(cls)) {
return (T) structures.get(uri, version);
} else if ("StructureMap".equals(cls)) {
return (T) transforms.get(uri, version);
} else if ("ValueSet".equals(cls)) {
return (T) valueSets.get(uri, version);
} else if ("CodeSystem".equals(cls)) {
return (T) codeSystems.get(uri, version);
} else if ("ConceptMap".equals(cls)) {
return (T) maps.get(uri, version);
} else if ("PlanDefinition".equals(cls)) {
return (T) plans.get(uri, version);
} else if ("OperationDefinition".equals(cls)) {
OperationDefinition od = operations.get(uri, version);
return (T) od;
} else if ("Questionnaire.class".equals(cls)) {
return (T) questionnaires.get(uri, version);
} else if ("SearchParameter.class".equals(cls)) {
SearchParameter res = searchParameters.get(uri, version);
return (T) res;
}
if ("CodeSystem".equals(cls) && codeSystems.has(uri)) {
return (T) codeSystems.get(uri, version);
}
if ("ValueSet".equals(cls) && valueSets.has(uri)) {
return (T) valueSets.get(uri, version);
}
if ("Questionnaire".equals(cls)) {
return (T) questionnaires.get(uri, version);
}
if (cls == null) {
if (uri.matches(Constants.URI_REGEX) && !uri.contains("ValueSet")) {
return null;
}
// it might be a special URL.
if (Utilities.isAbsoluteUrl(uri) || uri.startsWith("ValueSet/")) {
// findTxValueSet(uri);
Resource res = null;
if (res != null) {
return (T) res;
}
}
return null;
}
if (supportedCodeSystems.contains(uri)) {
return null;
}
throw new FHIRException(formatMessage(I18nConstants.NOT_DONE_YET_CANT_FETCH_, uri));
}
}
Aggregations