use of org.hl7.fhir.r5.model.UrlType in project org.hl7.fhir.core by hapifhir.
the class UrlTypeNullTest method equalsDeep.
@Test
@DisplayName("Test null value equalsDeep()")
void equalsDeep() {
UrlType nullUrl = new UrlType();
UrlType validUrl = new UrlType("tinyurl.com/45mpbc5d");
Assertions.assertFalse(nullUrl.equalsDeep(validUrl));
}
use of org.hl7.fhir.r5.model.UrlType in project org.hl7.fhir.core by hapifhir.
the class UrlTypeNullTest method typedCopy.
@Test
@DisplayName("Test null value typedCopy()")
void typedCopy() {
UrlType nullUrl = new UrlType();
UrlType copyUrl = (UrlType) nullUrl.typedCopy();
Assertions.assertNull(copyUrl.getValue());
}
use of org.hl7.fhir.r5.model.UrlType in project fhir-bridge by ehrbase.
the class SmartOnFhirAuthorizationInterceptor method addSmartOFWildcardAccess.
/*Allows wildcard access for CRUD operations for a
*particular FHIR resource type. Read access allows search, as long as there is a subject
* criteria that matches the patient provided in the access token.
* @param pSmartOnFhirPatientId The value from the patient claim of OAuth2 access token
* @param rules The collection to which rules are added. These will be used for access
* control later by the HAPI FHIR pipeline
* @param pResourceType The FHIR resource type for which the wildcard access will apply.
*/
private void addSmartOFWildcardAccess(String pSmartOnFhirPatientId, List<IAuthRule> rules, Class<? extends Resource> pResourceType) {
IdType sofId = new IdType(new UrlType(patientUrl + pSmartOnFhirPatientId));
rules.addAll(buildCreateRule("rule_create_own_sof_" + pResourceType.getSimpleName() + RESOURCE_POSTFIX, pResourceType, Patient.class.getSimpleName(), sofId));
rules.addAll(buildReadRule("rule_read_own_sof_" + pResourceType.getSimpleName() + RESOURCE_POSTFIX, pResourceType, Patient.class.getSimpleName(), sofId));
rules.addAll(buildWriteRule("rule_write_own_sof_" + pResourceType.getSimpleName() + RESOURCE_POSTFIX, pResourceType, Patient.class.getSimpleName(), sofId));
rules.addAll(buildDeleteRule("rule_delete_own_sof_" + pResourceType.getSimpleName() + RESOURCE_POSTFIX, pResourceType, Patient.class.getSimpleName(), sofId));
}
use of org.hl7.fhir.r5.model.UrlType in project pathling by aehrc.
the class ExtractResponse method toParameters.
/**
* Converts this to a {@link Parameters} resource, based on the definition of the result of the
* "extract" operation within the OperationDefinition.
*
* @return a new {@link Parameters} object
*/
public Parameters toParameters() {
final Parameters parameters = new Parameters();
final ParametersParameterComponent urlParameter = new ParametersParameterComponent();
urlParameter.setName("url");
urlParameter.setValue(new UrlType(url));
parameters.getParameter().add(urlParameter);
return parameters;
}
use of org.hl7.fhir.r5.model.UrlType in project pathling by aehrc.
the class TestDataImporter method run.
@Override
public void run(final String... args) {
final String sourcePath = args[0];
final File srcNdJsonDir = new File(sourcePath);
final FileFilter fileFilter = new WildcardFileFilter("*.ndjson");
final File[] srcNdJsonFiles = srcNdJsonDir.listFiles(fileFilter);
final List<ParametersParameterComponent> sources = Stream.of(Objects.requireNonNull(srcNdJsonFiles)).map(file -> {
final String resourceName = FilenameUtils.getBaseName(file.getName());
final ResourceType subjectResource = ResourceType.valueOf(resourceName.toUpperCase());
final ParametersParameterComponent source = new ParametersParameterComponent();
source.setName("source");
final ParametersParameterComponent resourceType = new ParametersParameterComponent();
resourceType.setName("resourceType");
resourceType.setValue(new CodeType(subjectResource.toCode()));
source.addPart(resourceType);
final ParametersParameterComponent url = new ParametersParameterComponent();
url.setName("url");
url.setValue(new UrlType("file://" + file.toPath()));
source.addPart(url);
return source;
}).collect(Collectors.toList());
final Parameters parameters = new Parameters();
parameters.setParameter(sources);
importExecutor.execute(parameters);
}
Aggregations