Skip to content

Commit 248b054

Browse files
Gateway docs adjustment
1 parent 81db028 commit 248b054

1 file changed

Lines changed: 32 additions & 7 deletions

File tree

healthchain/gateway/fhir/base.py

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,23 @@ def _register_base_routes(self):
9898
def capability_statement(
9999
fhir: "BaseFHIRGateway" = Depends(get_self_gateway),
100100
):
101-
"""Return the FHIR capability statement for this gateway's services."""
101+
"""Return the FHIR capability statement for this gateway's services.
102+
103+
Includes both custom transform/aggregate operations (via REST endpoints)
104+
and standard FHIR CRUD operations (via Python gateway methods).
105+
"""
102106
return fhir.build_capability_statement().model_dump()
103107

104108
# Gateway status endpoint - returns operational metadata
105109
@self.get("/status", response_class=JSONResponse)
106110
def gateway_status(
107111
fhir: "BaseFHIRGateway" = Depends(get_self_gateway),
108112
):
109-
"""Return operational status and metadata for this gateway."""
113+
"""Return operational status and metadata for this gateway.
114+
115+
Includes information about supported FHIR CRUD operations,
116+
custom transform/aggregate operations, and connected sources.
117+
"""
110118
return fhir.get_gateway_status()
111119

112120
def build_capability_statement(self) -> CapabilityStatement:
@@ -117,7 +125,7 @@ def build_capability_statement(self) -> CapabilityStatement:
117125
handlers, available FHIR sources, and supported operations.
118126
119127
Returns:
120-
CapabilityStatement: Enhanced FHIR-compliant capability statement
128+
CapabilityStatement: FHIR-compliant capability statement for gateway operations
121129
"""
122130
# Build resource entries based on registered handlers
123131
resources = []
@@ -128,12 +136,22 @@ def build_capability_statement(self) -> CapabilityStatement:
128136
# Add supported interactions based on registered handlers
129137
for operation in operations:
130138
if operation == "transform":
131-
interactions.append({"code": "read"})
139+
interactions.append(
140+
{
141+
"code": "read",
142+
"documentation": "Custom transformation via REST endpoint",
143+
}
144+
)
132145
operation_details.append(
133146
"Transform: Custom resource transformation"
134147
)
135148
elif operation == "aggregate":
136-
interactions.append({"code": "search-type"})
149+
interactions.append(
150+
{
151+
"code": "search-type",
152+
"documentation": "Multi-source aggregation via REST endpoint",
153+
}
154+
)
137155
operation_details.append("Aggregate: Multi-source data aggregation")
138156

139157
if interactions:
@@ -154,9 +172,15 @@ def build_capability_statement(self) -> CapabilityStatement:
154172
sources_info.append(f"Source: {source_name}")
155173

156174
# Enhanced documentation with examples
175+
sources_list = (
176+
", ".join(self.connection_manager.sources.keys())
177+
if self.connection_manager and hasattr(self.connection_manager, "sources")
178+
else "None configured"
179+
)
157180
rest_documentation = (
158181
"HealthChain FHIR Gateway provides transformation and aggregation services. "
159-
f"Available sources: {', '.join(self.connection_manager.sources.keys()) if self.connection_manager and hasattr(self.connection_manager, 'sources') else 'None configured'}. "
182+
f"Gateway also provides standard FHIR CRUD operations (create, read, update, delete, search) to connected FHIR servers via Python API. "
183+
f"Available sources: {sources_list}. "
160184
"Use /status endpoint for operational details."
161185
)
162186

@@ -209,7 +233,8 @@ def get_gateway_status(self) -> Dict[str, Any]:
209233
"""
210234
Get operational status and metadata for this gateway.
211235
212-
Enhanced with detailed FHIR operation discovery information.
236+
Enhanced with detailed FHIR operation discovery information including
237+
both standard CRUD operations and custom transform/aggregate operations.
213238
214239
Returns:
215240
Dict containing gateway operational status and metadata

0 commit comments

Comments
 (0)