Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "5.49.1",
"cliVersion": "5.50.1",
"generatorName": "fernapi/fern-java-sdk",
"generatorVersion": "4.9.2",
"generatorConfig": {
Expand All @@ -10,10 +10,10 @@
"enable-wire-tests": true,
"publish-to": "central"
},
"originGitCommit": "64f369254225bd6c2d4c58d87f59165d7e8e8dc9",
"originGitCommit": "fbaef4c66e97232edfaacb20d23d476aa286ecdd",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "17.5.0"
"sdkVersion": "17.6.0"
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ java {

group = 'com.phenoml.maven'

version = '17.5.0'
version = '17.6.0'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.phenoml.maven'
artifactId = 'phenoml-java-sdk'
version = '17.5.0'
version = '17.6.0'
from components.java
pom {
name = 'phenoml'
Expand Down
10 changes: 9 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [17.6.0] - 2026-06-18
### Added
- **`ConflictError`** — new typed exception thrown by `RawChatClient.send(...)`, `RawChatClient.stream(...)`, `AsyncRawChatClient.send(...)`, and `AsyncRawChatClient.stream(...)` for HTTP 409 responses when a session already has an active turn.

### Changed
- **`AgentChatRequest.getSessionId()` and `AgentStreamChatRequest.getSessionId()`** — Javadoc now states that only one request may be active per session at a time and overlapping turns return `409 Conflict`.
- **`Fhir2OmopClient.create(...)` and `AsyncFhir2OmopClient.create(...)`** — Javadoc now lists the supported FHIR resource-to-OMOP table mappings and clarifies that unsupported resource types are accepted but ignored.
- **`CreateOmopResponse.getDropped()`** — Javadoc now clarifies that only supported resources missing required subject/patient, code, or medication reference data appear in `dropped`; unsupported resource types are ignored.

## [17.5.0] - 2026-06-15
### Added
- **`Provider.AIDBOX`** — `"aidbox"` is now a supported value in the `Provider` enum (with a corresponding `Visitor.visitAidbox()` method).
Expand Down Expand Up @@ -578,4 +587,3 @@ import com.phenoml.api.PhenomlClient;
* Update documentation to reflect removal of active status filtering
* Simplify agent creation workflow by removing active status requirement
* 🌿 Generated with Fern

4 changes: 2 additions & 2 deletions code-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"metadata": {
"language": "java",
"packageName": "com.phenoml.maven:phenoml-java-sdk",
"sdkVersion": "17.5.0",
"specCommit": "64f369254225bd6c2d4c58d87f59165d7e8e8dc9",
"sdkVersion": "17.6.0",
"specCommit": "fbaef4c66e97232edfaacb20d23d476aa286ecdd",
"generatorName": "fernapi/fern-java-sdk"
},
"renderRules": {
Expand Down
39 changes: 34 additions & 5 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ Multiple FHIR provider integrations can be provided as comma-separated values.
<dl>
<dd>

**sessionId:** `Optional<String>` — Optional session ID for conversation continuity
**sessionId:** `Optional<String>` — Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.

</dd>
</dl>
Expand Down Expand Up @@ -605,7 +605,7 @@ Multiple FHIR provider integrations can be provided as comma-separated values.
<dl>
<dd>

**sessionId:** `Optional<String>` — Optional session ID for conversation continuity
**sessionId:** `Optional<String>` — Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.

</dd>
</dl>
Expand Down Expand Up @@ -3036,6 +3036,32 @@ Maps a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows
(person, visit_occurrence, condition_occurrence, drug_exposure,
procedure_occurrence, measurement, observation).

Resource support is intentionally limited to the OMOP tables returned by
this endpoint:
- `Patient` -> `person`
- `Encounter` -> `visit_occurrence`
- `Condition` -> `condition_occurrence`
- `Procedure` -> `procedure_occurrence`
- `MedicationRequest`, `MedicationStatement`, and
`MedicationAdministration` -> `drug_exposure`
- `Immunization` -> `drug_exposure`
- `Observation` with a numeric `valueQuantity`, `valueInteger`, or
numeric-looking `valueString` (for example `"<2"`) -> `measurement`
- non-numeric `Observation` -> `observation`
- `AllergyIntolerance` -> `observation`

`Medication` is supported only as reference data for medication
resources; it is not emitted as its own row because OMOP CDM has no
Medication table. Other reference/admin resources such as `Practitioner`,
`Organization`, `Location`, `Coverage`, and `Claim`, and clinical
workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
`DeviceUseStatement`, are currently accepted in a Bundle but are not
shaped into OMOP rows. Unsupported resource types are ignored rather than
listed under `dropped`; `dropped` is reserved for supported resource types
that were missing the subject/patient, code, or medication reference data
needed to produce a valid row.

Each resource's primary clinical coding is resolved to a standard OMOP
`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
response carries `mappings` (how each source coding resolved, linked back
Expand Down Expand Up @@ -3151,9 +3177,12 @@ client.fhir2Omop().create(
**fhirResources:** `Map<String, Object>`

FHIR resources (single resource or Bundle). Must contain at least one
Patient resource. Resources are mapped to OMOP rows; standalone
Medication resources are consumed by medication references rather than
mapped to their own table.
Patient resource. Supported row-producing resources are Patient,
Encounter, Condition, Procedure, MedicationRequest,
MedicationStatement, MedicationAdministration, Immunization,
Observation, and AllergyIntolerance. Standalone Medication resources
are consumed by medication references rather than mapped to their own
table. Other resource types are accepted but ignored.

</dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/phenoml/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.phenoml.maven:phenoml-java-sdk/17.5.0");
put("User-Agent", "com.phenoml.maven:phenoml-java-sdk/17.6.0");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.phenoml.fern:api-sdk");
put("X-Fern-SDK-Version", "17.5.0");
put("X-Fern-SDK-Version", "17.6.0");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.phenoml.api.resources.agent.chat.requests.ListMessagesRequest;
import com.phenoml.api.resources.agent.chat.types.ListMessagesResponse;
import com.phenoml.api.resources.agent.errors.BadRequestError;
import com.phenoml.api.resources.agent.errors.ConflictError;
import com.phenoml.api.resources.agent.errors.ForbiddenError;
import com.phenoml.api.resources.agent.errors.GatewayTimeoutError;
import com.phenoml.api.resources.agent.errors.InternalServerError;
Expand Down Expand Up @@ -127,6 +128,11 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
response));
return;
case 409:
future.completeExceptionally(new ConflictError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
response));
return;
case 500:
future.completeExceptionally(new InternalServerError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
Expand Down Expand Up @@ -244,6 +250,11 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
response));
return;
case 409:
future.completeExceptionally(new ConflictError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
response));
return;
case 500:
future.completeExceptionally(new InternalServerError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.phenoml.api.resources.agent.chat.requests.ListMessagesRequest;
import com.phenoml.api.resources.agent.chat.types.ListMessagesResponse;
import com.phenoml.api.resources.agent.errors.BadRequestError;
import com.phenoml.api.resources.agent.errors.ConflictError;
import com.phenoml.api.resources.agent.errors.ForbiddenError;
import com.phenoml.api.resources.agent.errors.GatewayTimeoutError;
import com.phenoml.api.resources.agent.errors.InternalServerError;
Expand Down Expand Up @@ -109,6 +110,9 @@ public PhenomlClientHttpResponse<AgentChatResponse> send(AgentChatRequest reques
case 404:
throw new NotFoundError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
case 409:
throw new ConflictError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
case 500:
throw new InternalServerError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
Expand Down Expand Up @@ -199,6 +203,9 @@ public PhenomlClientHttpResponse<Iterable<AgentChatStreamEvent>> stream(
case 404:
throw new NotFoundError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
case 409:
throw new ConflictError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
case 500:
throw new InternalServerError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public Optional<String> getContext() {
}

/**
* @return Optional session ID for conversation continuity
* @return Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.
*/
@JsonProperty("session_id")
public Optional<String> getSessionId() {
Expand Down Expand Up @@ -204,7 +204,7 @@ public interface _FinalStage {
_FinalStage context(String context);

/**
* <p>Optional session ID for conversation continuity</p>
* <p>Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.</p>
*/
_FinalStage sessionId(Optional<String> sessionId);

Expand Down Expand Up @@ -296,7 +296,7 @@ public _FinalStage enhancedReasoning(Optional<Boolean> enhancedReasoning) {
}

/**
* <p>Optional session ID for conversation continuity</p>
* <p>Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
Expand All @@ -306,7 +306,7 @@ public _FinalStage sessionId(String sessionId) {
}

/**
* <p>Optional session ID for conversation continuity</p>
* <p>Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.</p>
*/
@java.lang.Override
@JsonSetter(value = "session_id", nulls = Nulls.SKIP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public Optional<String> getContext() {
}

/**
* @return Optional session ID for conversation continuity
* @return Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.
*/
@JsonProperty("session_id")
public Optional<String> getSessionId() {
Expand Down Expand Up @@ -204,7 +204,7 @@ public interface _FinalStage {
_FinalStage context(String context);

/**
* <p>Optional session ID for conversation continuity</p>
* <p>Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.</p>
*/
_FinalStage sessionId(Optional<String> sessionId);

Expand Down Expand Up @@ -296,7 +296,7 @@ public _FinalStage enhancedReasoning(Optional<Boolean> enhancedReasoning) {
}

/**
* <p>Optional session ID for conversation continuity</p>
* <p>Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
Expand All @@ -306,7 +306,7 @@ public _FinalStage sessionId(String sessionId) {
}

/**
* <p>Optional session ID for conversation continuity</p>
* <p>Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict.</p>
*/
@java.lang.Override
@JsonSetter(value = "session_id", nulls = Nulls.SKIP)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.phenoml.api.resources.agent.errors;

import com.phenoml.api.core.PhenomlClientApiException;
import okhttp3.Response;

public final class ConflictError extends PhenomlClientApiException {
/**
* The body of the response that triggered the exception.
*/
private final Object body;

public ConflictError(Object body) {
super("ConflictError", 409, body);
this.body = body;
}

public ConflictError(Object body, Response rawResponse) {
super("ConflictError", 409, body, rawResponse);
this.body = body;
}

/**
* @return the body
*/
@java.lang.Override
public Object body() {
return this.body;
}
}
Loading