Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'access_control'
Browse files Browse the repository at this point in the history
  • Loading branch information
hhund committed Mar 17, 2020
2 parents 9e6b659 + d7054f4 commit f0908d5
Show file tree
Hide file tree
Showing 411 changed files with 16,476 additions and 3,114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public interface Constants

String PROCESS_URI_BASE = "http://highmed.org/bpe/Process/";

String ORGANIZATION_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/CodeSystem/organization";
String ORGANIZATION_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/organization-identifier";
String ORGANIZATION_TYPE_SYSTEM = "http://highmed.org/fhir/CodeSystem/organization-type";
String ENDPOINT_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/CodeSystem/endpoint";
String ENDPOINT_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/endpoint-identifier";

String EXTENSION_PARTICIPATING_MEDIC_URI = "http://highmed.org/fhir/StructureDefinition/participating-medic";
String EXTENSION_QUERY_URI = "http://highmed.org/fhir/StructureDefinition/query";
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer;
import org.camunda.bpm.engine.impl.variable.serializer.ValueFields;
import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl;
import org.highmed.dsf.fhir.variables.FeasibilityQueryResultValues.FeasibilityQueryResultValue;
import org.springframework.beans.factory.InitializingBean;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class FeasibilityQueryResultSerializer
extends PrimitiveValueSerializer<FeasibilityQueryResultValues.FeasibilityQueryResultValue>
public class FeasibilityQueryResultSerializer extends PrimitiveValueSerializer<FeasibilityQueryResultValue>
implements InitializingBean
{
private final ObjectMapper objectMapper;
Expand All @@ -31,7 +31,7 @@ public void afterPropertiesSet() throws Exception
}

@Override
public void writeValue(FeasibilityQueryResultValues.FeasibilityQueryResultValue value, ValueFields valueFields)
public void writeValue(FeasibilityQueryResultValue value, ValueFields valueFields)
{
FeasibilityQueryResult target = value.getValue();
try
Expand All @@ -46,21 +46,20 @@ public void writeValue(FeasibilityQueryResultValues.FeasibilityQueryResultValue
}

@Override
public FeasibilityQueryResultValues.FeasibilityQueryResultValue convertToTypedValue(UntypedValueImpl untypedValue)
public FeasibilityQueryResultValue convertToTypedValue(UntypedValueImpl untypedValue)
{
return FeasibilityQueryResultValues.create((FeasibilityQueryResult) untypedValue.getValue());
}

@Override
public FeasibilityQueryResultValues.FeasibilityQueryResultValue readValue(ValueFields valueFields)
public FeasibilityQueryResultValue readValue(ValueFields valueFields)
{
byte[] bytes = valueFields.getByteArrayValue();

try
{
FeasibilityQueryResult target = (bytes == null || bytes.length <= 0) ?
null :
objectMapper.readValue(bytes, FeasibilityQueryResult.class);
FeasibilityQueryResult target = (bytes == null || bytes.length <= 0) ? null
: objectMapper.readValue(bytes, FeasibilityQueryResult.class);
return FeasibilityQueryResultValues.create(target);
}
catch (IOException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer;
import org.camunda.bpm.engine.impl.variable.serializer.ValueFields;
import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl;
import org.highmed.dsf.fhir.variables.FeasibilityQueryResultsValues.FeasibilityQueryResultsValue;
import org.springframework.beans.factory.InitializingBean;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class FeasibilityQueryResultsSerializer
extends PrimitiveValueSerializer<FeasibilityQueryResultsValues.FeasibilityQueryResultsValue>
public class FeasibilityQueryResultsSerializer extends PrimitiveValueSerializer<FeasibilityQueryResultsValue>
implements InitializingBean
{
private final ObjectMapper objectMapper;
Expand All @@ -31,7 +31,7 @@ public void afterPropertiesSet() throws Exception
}

@Override
public void writeValue(FeasibilityQueryResultsValues.FeasibilityQueryResultsValue value, ValueFields valueFields)
public void writeValue(FeasibilityQueryResultsValue value, ValueFields valueFields)
{
FeasibilityQueryResults targets = value.getValue();
try
Expand All @@ -46,21 +46,20 @@ public void writeValue(FeasibilityQueryResultsValues.FeasibilityQueryResultsValu
}

@Override
public FeasibilityQueryResultsValues.FeasibilityQueryResultsValue convertToTypedValue(UntypedValueImpl untypedValue)
public FeasibilityQueryResultsValue convertToTypedValue(UntypedValueImpl untypedValue)
{
return FeasibilityQueryResultsValues.create((FeasibilityQueryResults) untypedValue.getValue());
}

@Override
public FeasibilityQueryResultsValues.FeasibilityQueryResultsValue readValue(ValueFields valueFields)
public FeasibilityQueryResultsValue readValue(ValueFields valueFields)
{
byte[] bytes = valueFields.getByteArrayValue();

try
{
FeasibilityQueryResults targets = (bytes == null || bytes.length <= 0) ?
null :
objectMapper.readValue(bytes, FeasibilityQueryResults.class);
FeasibilityQueryResults targets = (bytes == null || bytes.length <= 0) ? null
: objectMapper.readValue(bytes, FeasibilityQueryResults.class);
return FeasibilityQueryResultsValues.create(targets);
}
catch (IOException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ public class FhirPlugin implements ProcessEnginePlugin
@SuppressWarnings("rawtypes")
private final List<TypedValueSerializer> serializer;

public FhirPlugin(DomainResourceSerializer domainResourceSerializer,
public FhirPlugin(FhirResourceSerializer fhirResourceSerializer,
FhirResourcesListSerializer fhirResourcesListSerializer,
MultiInstanceTargetSerializer multiInstanceTargetSerializer,
MultiInstanceTargetsSerializer multiInstanceTargetsSerializer,
FeasibilityQueryResultSerializer feasibilityQueryResultSerializer,
FeasibilityQueryResultsSerializer feasibilityQueryResultsSerializer, OutputSerializer outputSerializer,
OutputsSerializer outputsSerializer)
{
serializer = Arrays
.asList(domainResourceSerializer, multiInstanceTargetSerializer, multiInstanceTargetsSerializer,
feasibilityQueryResultSerializer, feasibilityQueryResultsSerializer, outputSerializer,
outputsSerializer);
serializer = Arrays.asList(fhirResourceSerializer, fhirResourcesListSerializer, multiInstanceTargetSerializer,
multiInstanceTargetsSerializer, feasibilityQueryResultSerializer, feasibilityQueryResultsSerializer,
outputSerializer, outputsSerializer);
}

@Override
Expand Down
19 changes: 14 additions & 5 deletions ...r/variables/OrganizationDeserializer.java → ...bles/FhirResourceJacksonDeserializer.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@
import java.io.IOException;
import java.util.Objects;

import org.hl7.fhir.r4.model.Organization;
import org.hl7.fhir.r4.model.Resource;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;

public class OrganizationDeserializer extends JsonDeserializer<Organization>
public class FhirResourceJacksonDeserializer extends JsonDeserializer<Resource>
{
private final FhirContext fhirContext;

public OrganizationDeserializer(FhirContext fhirContext)
public FhirResourceJacksonDeserializer(FhirContext fhirContext)
{
this.fhirContext = Objects.requireNonNull(fhirContext, "fhirContext");
}

@Override
public Organization deserialize(JsonParser p, DeserializationContext ctxt)
public Resource deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JsonProcessingException
{
String string = p.readValueAsTree().toString();
return fhirContext.newJsonParser().parseResource(Organization.class, string);
return (Resource) newJsonParser().parseResource(string);
}

private IParser newJsonParser()
{
IParser p = fhirContext.newJsonParser();
p.setStripVersionsFromReferences(false);
p.setOverrideResourceIdWithBundleEntryFullUrl(false);
return p;
}
}
19 changes: 14 additions & 5 deletions ...hir/variables/OrganizationSerializer.java → ...iables/FhirResourceJacksonSerializer.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@
import java.io.IOException;
import java.util.Objects;

import org.hl7.fhir.r4.model.Organization;
import org.hl7.fhir.r4.model.Resource;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;

public class OrganizationSerializer extends JsonSerializer<Organization>
public class FhirResourceJacksonSerializer extends JsonSerializer<Resource>
{
private final FhirContext fhirContext;

public OrganizationSerializer(FhirContext fhirContext)
public FhirResourceJacksonSerializer(FhirContext fhirContext)
{
this.fhirContext = Objects.requireNonNull(fhirContext, "fhirContext");
}

@Override
public void serialize(Organization value, JsonGenerator jgen, SerializerProvider provider)
public void serialize(Resource value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonGenerationException
{
String text = fhirContext.newJsonParser().encodeResourceToString(value);
String text = newJsonParser().encodeResourceToString(value);
jgen.writeRawValue(text);
}

private IParser newJsonParser()
{
IParser p = fhirContext.newJsonParser();
p.setStripVersionsFromReferences(false);
p.setOverrideResourceIdWithBundleEntryFullUrl(false);
return p;
}
}
Loading

0 comments on commit f0908d5

Please sign in to comment.